1

您能否指导解决我遇到的错误?

在我的本地环境中运行它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

所有先决条件都已运行,这发生在最后一步:

我也尝试从这里下载包:

http://www.microsoft.com/en-us/download/details.aspx?id=29995

4

2 回答 2

2

我也有这个问题。最后我切换到这个驱动程序:https ://github.com/patriksimek/node-mssql

于 2014-02-19T18:57:19.650 回答
0

正如我在评论中所说。您确定您拥有软件包所需的所有先决条件吗?

在使用驱动程序之前,需要满足以下先决条件:

Node.js - 尽可能使用最新版本,但已在节点 0.6.10 及更高版本上测试过

node-gyp - 全局安装的最新版本(npm install -g node-gyp)

python 2.7.x - 用于 node-gyp(确保它在路径中)

Visual C++ 2010 - Express 版可从 Microsoft 免费获得

SQL Server Native Client 11.0 - 可作为 SQL Server 2012 功能包中的 Microsoft SQL Server 2012 Native Client

我从 github 页面获取了这个。

于 2014-02-19T18:59:24.320 回答