您能否请求指南解决我遇到的错误?
在我的本地环境npm install node-sqlserver
我最后收到了这个错误:
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
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:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Felipe\AppData\Roaming\npm\node_modules\node-sqlserver
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! node-sqlserver@0.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sqlserver@0.1.0 install script.
npm ERR! This is most likely a problem with the node-sqlserver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sqlserver
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sqlserver" "-g"
npm ERR! cwd C:\
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\npm-debug.log
npm ERR! not ok code 0
更新1
已经运行了所有先决条件,这发生在最后一步:
npm install -g node-gyp
npm install node-sqlserver -g
我也试过从这里下载软件包:
http://www.microsoft.com/en-us/download/details.aspx?id=29995
答案 0 :(得分:2)
我也有这个问题。最后我切换到了这个驱动程序:https://github.com/patriksimek/node-mssql
答案 1 :(得分:0)
在使用驱动程序之前,必须满足以下先决条件:
Node.js - 尽可能使用最新版本,但已在节点0.6.10及更高版本上测试
node-gyp - 全局安装的最新版本(npm install -g node-gyp)
python 2.7.x - 对于node-gyp(确保它在路径中)
Visual C ++ 2010 - 可从Microsoft免费获得Express版
SQL Server Native Client 11.0 - 作为SQL Server 2012 Feature Pack中的Microsoft SQL Server 2012 Native Client提供
我是从github页面上看到的。