node.js:构建 msnodesql 失败

标签 node.js windows-8 sql-server-2012

我想从 node.js 连接到 Windows8 上的 MSSQL,但我无法让它工作:(

如果我运行node-gyp configure build

我收到此错误

gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\mkirchweger\AppData\Roaming\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Users\\mkirchweger\\AppData\\Roaming\\npm\\node_mod
ules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd D:\Bibliotheken\node_test\node_modules\msnodesql
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok

如果我尝试在没有构建的情况下运行我的node.js应用程序,我当然会收到消息

Error: Cannot find module '../build/Release/sqlserver.node'

最佳答案

我应该先说一下,node.js 模块“Node-sqlserver”已重命名为“MSNodeSQL”。

我能够通过访问模块 github 找到所需的更改:https://github.com/WindowsAzure/node-sqlserver/tree/master/src

在上面的链接中,Operation.h 下概述了更改

更改为 from(第 38 行):

int result = uv_queue_work(uv_default_loop(), &operation->work, OnBackground, OnForeground);

致:

int result = uv_queue_work(uv_default_loop(), &operation->work, OnBackground, (uv_after_work_cb)OnForeground);

我希望这个答案足够了。

关于node.js:构建 msnodesql 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18829257/

相关文章:

c# - 如何使用 Windows.Web.Http 下载和存储图像?

sql-server-2012 - 如何以编程方式创建 localdb .mdf?

javascript - 如何在不调用的情况下使用鼠标选择 Metro ListView 项?

sql - 无法在存储过程中调用存储过程

c# - 在 .Any() LINQ 查询中将 'string' 转换为 'int'

javascript - JSON.parse 没有预期的行为

javascript - Nuxt.js 模块中未定义 process.server

javascript - NodeJS 和 React : bundle. js 已生成,但出现错误 404(无法加载资源)

python - 以编程方式获取给定 PID 的子进程列表

c# - 添加 .NET Framework DLL 作为对 Windows 应用商店应用程序的引用