问题描述
我使用 meanjs 作为基于 mongodb、nodejs、angularjs 的项目的样板代码.我在远程服务器上克隆了我的项目并在安装过程中遇到以下错误
I am using meanjs as boiler plate code for my project based on mongodb, nodejs, angularjs. I cloned my project in remote server and facing following error during installation
npm ERR! [email protected] postinstall: `bower install --config.interactive=false`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the meanjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install --config.interactive=false
npm ERR! You can get their info via:
npm ERR! npm owner ls meanjs
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /home/ubuntu/xyz/xyz
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.3.26
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/xyz/xyz/npm-debug.log
npm ERR! not ok code 0
当我打开调试日志时,以下是存在的错误.Meanjs 支持 Node 0.10.x 版,npm 1.3.x 版.我的 nodejs 和 npm 版本是 v0.10.35 和 1.3.26.
When I open the debug log following are the errors present. Meanjs supports Node version 0.10.x, npm version 1.3.x. My nodejs and npm versions are v0.10.35 and 1.3.26.
102 info install [email protected]
103 info postinstall [email protected]
104 verbose unsafe-perm in lifecycle true
105 info [email protected] Failed to exec postinstall script
106 error [email protected] postinstall: `bower install --config.interactive=false`
106 error Exit status 1
107 error Failed at the [email protected] postinstall script.
107 error This is most likely a problem with the meanjs package,
107 error not with npm itself.
107 error Tell the author that this fails on your system:
107 error bower install --config.interactive=false
107 error You can get their info via:
107 error npm owner ls meanjs
107 error There is likely additional logging output above.
108 error System Linux 3.13.0-36-generic
109 error command "node" "/usr/bin/npm" "install"
110 error cwd /home/ubuntu/xyz/xyz
111 error node -v v0.10.35
112 error npm -v 1.3.26
113 error code ELIFECYCLE
114 verbose exit [ 1, true ]
推荐答案
你可能有依赖冲突,如果有,请使用 Bower.json 中的 ="nofollow">分辨率.
You might have dependencies conflict, if so use resolutions in the Bower.json.
示例:
{
"name": "test",
"version": "0.0.1",
"description": "test",
"dependencies": {
"bootstrap": "~3.3.2",
"angular": "~1.3.12",
"angular-resource": "~1.3.12"
},
"devDependencies": {
"angular-mocks": "~1.3.12",
"angular-ui-utils": "~0.2.1"
},
"resolutions": {
"angular": "~1.3.12"
}
}
如果这不起作用,那么它可能是用于缓存的/app/.cache/bower/,它是公共的并由多个用户共享.创建一个临时文件夹并在 .bowerrc中指向它强>.
If that did not work then it might be the /app/.cache/bower/ used for cache, its common and shared by multiple users.Create a temp folder and point to it in the .bowerrc.
示例:
{
"directory": "public/lib",
"storage":{ "packages":"temp" }
}
不要忘记将 temp 放在 .gitignore 列表中,以免部署本地创建的文件夹.
Don't forget to put temp on .gitignore list so not to deploy the folders created locally.
示例:
temp/*
这篇关于npm install 错误 - 在 [email protected] 安装后脚本失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!