npm错误代码ELIFECYCLE用于postinstall bower安装

时间:2015-11-27 17:13:49

标签: node.js git npm

运行npm install时出现以下错误:

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用户配置文件正确设置了我的环境变量。我的node-gyp正在成功构建/重建。想知道为什么会这样?

1 个答案:

答案 0 :(得分:1)

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

C:\Users\DemoUser\AppData\Local\Programs\Git\bin
C:\Users\DemoUser\AppData\Local\Programs\Git\cmd

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

谢谢!