简体   繁体   English

npm install错误-在meanjs@0.3.3安装后脚本失败

[英]error with npm install - Failed at the meanjs@0.3.3 postinstall script

I am using meanjs as boiler plate code for my project based on mongodb, nodejs, angularjs. 我正在将meanjs用作基于mongodb,nodejs,angularjs的项目的样板代码。 I cloned my project in remote server and facing following error during installation 我在远程服务器中克隆了我的项目,并在安装过程中遇到以下错误

npm ERR! meanjs@0.3.3 postinstall: `bower install --config.interactive=false`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the meanjs@0.3.3 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

When I open the debug log following are the errors present. 当我打开调试日志时,下面是错误。 Meanjs supports Node version 0.10.x, npm version 1.3.x. Meanjs支持Node版本0.10.x,npm版本1.3.x。 My nodejs and npm versions are v0.10.35 and 1.3.26. 我的nodejs和npm版本是v0.10.35和1.3.26。

102 info install meanjs@0.3.3
103 info postinstall meanjs@0.3.3
104 verbose unsafe-perm in lifecycle true
105 info meanjs@0.3.3 Failed to exec postinstall script
106 error meanjs@0.3.3 postinstall: `bower install --config.interactive=false`
106 error Exit status 1
107 error Failed at the meanjs@0.3.3 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 ]

The postinstall command may be failing because bower is not installed as a global package (which will put the bower command into your PATH.) Try doing this to fix it: postinstall命令可能会失败,因为bower并未作为全局软件包安装(这会将bower命令放入您的PATH中。)请尝试执行以下操作来修复它:

npm install -g bower

Also, you should update npm to the latest version, as 1.3.26 is quite old and no longer supported: 另外,您应该将npm更新到最新版本,因为1.3.26已经很旧,不再受支持:

npm install -g npm@latest

You might have dependencies conflict, if so use resolutions in the Bower.json . 您可能会遇到依赖冲突,如果这样,请在Bower.json中使用解析度

example: 例:

{
 "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"
 }
}

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 . 如果那不起作用,那么它可能是/app/.cache/bower/用于缓存,它由多个用户共享和共享。创建一个临时文件夹并将其指向.bowerrc中

example: 例:

{
  "directory": "public/lib",
  "storage":{ "packages":"temp" }
}

Don't forget to put temp on .gitignore list so not to deploy the folders created locally. 不要忘记将temp放在.gitignore列表上,以免部署在本地创建的文件夹。

example: 例:

temp/*

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

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