我有nodejs和java代码的项目,该项目在MAC上工作良好,但
当尝试在Windows7 64位上安装项目时,我得到以下错误:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074
:12)
gyp ERR! System Windows_NT 6.1.7601
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\HDaghash\Documents\QosAdministration\node_modules\java
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! java@0.6.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java@0.6.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the java 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 java
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\HDaghash\Documents\QosAdministration\npm-debug.log我试图安装visual studio 2012而不是2013,就像我在github上看到的那样,但同样的问题仍然存在。
有谁可以帮助解决这个问题吗?
提前谢谢。
发布于 2016-01-27 21:09:41
它依赖于node-gyp节点模块,并且node-gyp不会安装在windows中。
发布于 2017-02-08 19:23:25
这就是解决方案。
Java安装程序
npm install -g node-gyp运行
在管理员特权命令提示符窗口中
npm install --global --production windows-build-tools
npm update
npm install javahttps://stackoverflow.com/questions/35035236
复制相似问题