简体   繁体   English

npm install导致gyp ERR! 构建错误(node-java)

[英]npm install lead to gyp ERR! build error (node-java)

i have project with nodejs & java code , the project working fine on MAC but 我有一个带有nodejs和Java代码的项目,该项目在MAC上工作正常,但是

when trying to install project on Windows7 64 bit i get the following error : 尝试在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

i tried to install visual studio 2012 instead of 2013 as i read in some tickets on github but the same issue still exist. 我尝试安装Visual Studio 2012而不是2013,因为我在github上读了一些票,但仍然存在相同的问题。

any one can help with this issue ? 任何人都可以帮助解决这个问题?

Thanks in advance . 提前致谢 。

它与node-gyp节点模块有关,并且node-gyp不在Windows中安装。

Here is the solution ... 这是解决方案...

Java Setup Java设置

npm install -g node-gyp

Run

in administrator privileged command prompt window 在管理员特权的命令提示符窗口中

npm install --global --production windows-build-tools
npm update
npm install java

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

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