安装后bower安装的npm错误代码为ELIFECYCLE



运行npm安装时出现以下错误:

66283 error Windows_NT 6.1.7601
66284 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
66285 error node v4.2.1
66286 error npm  v2.14.7
66287 error code ELIFECYCLE
66288 error MyProject@0.0.0 postinstall: `bower install`
66288 error Exit status 1
66289 error Failed at the MyProject@0.0.0 postinstall script 'bower install'.
66289 error This is most likely a problem with the MyProject package,
66289 error not with npm itself.
66289 error Tell the author that this fails on your system:
66289 error     bower install
66289 error You can get their info via:
66289 error     npm owner ls MyProject
66289 error There is likely additional logging output above.
66290 verbose exit [ 1, true ]

我已经为Python 2.7、git和npm用户配置文件正确设置了环境变量。我的节点gyp正在成功构建/重建。想知道为什么会发生这种事?

问题在于GIT环境变量。将以下内容添加到环境变量(PATH)中,它就开始工作了。

C:UsersDemoUserAppDataLocalProgramsGitbin
C:UsersDemoUserAppDataLocalProgramsGitcmd

请确保同时添加\bin和\cmd,否则它无法与安装过程中自动添加的默认\cmd PATH变量git一起使用。

谢谢!

最新更新