npm安装node-sqlserver在windows7上失败
你能指导解决我得到的错误吗?
Ater在我的本地环境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
所有先决条件已经运行,这发生在最后一步:
- 安装Python 2.7 http://www.python.org/download/releases/2.7.6/
- 然后我安装了
npm install -g node-gyp
- 由于我有VS.NET 2013,我不必安装C ++组件或SQL Server客户端
-
npm install node-sqlserver -g
我也尝试从这里downlaoding包:
http://www.microsoft.com/en-us/download/details.aspx?id=29995
我也有这个问题。 最后我切换到这个驱动程序: https : //github.com/patriksimek/node-mssql
正如我在评论中所说的。 你确定你有包所需的所有先决条件吗?
在使用驱动程序之前,以下先决条件是必需的:
Node.js – 尽可能使用最新版本,但已经在节点0.6.10及更高版本上进行了testing
node-gyp – 全局安装的最新版本(npm install -g node-gyp)
python 2.7.x – 对于node-gyp(确保它在path中)
Visual C ++ 2010 – Express版本可从Microsoft免费获得
SQL Server Native Client 11.0 – 作为SQL Server 2012 Feature Pack中的Microsoft SQL Server 2012 Native Client提供
我从github页面中获取了这个。