简体   繁体   English

node.js:构建msnodesql失败

[英]node.js: building msnodesql fails

I want to connect from node.js to an MSSQL on Windows8 but I can´t get it working :( 我想从node.js连接到Windows8上的MSSQL,但我无法正常工作:(

if I run node-gyp configure build 如果我运行node-gyp configure build

I get this ERROR 我得到这个错误

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

If I try to run my node.js app without the build of course I get the Message 如果我尝试在没有构建的情况下运行node.js应用程序,则会收到消息

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

I should preface that the node.js module "Node-sqlserver" was renamed "MSNodeSQL". 我应该先将node.js模块“ Node-sqlserver”重命名为“ MSNodeSQL”。

I was able to find the changes required by going to the modules github at https://github.com/WindowsAzure/node-sqlserver/tree/master/src 我可以通过转到https://github.com/WindowsAzure/node-sqlserver/tree/master/src上的 github模块找到所需的更改

At the link above, the change is outlined under Operation.h 在上面的链接中,更改概述在Operation.h下

Change to from (line 38): 更改为(第38行):

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

To: 至:

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

I hope this answer is sufficient. 我希望这个答案足够。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM