node.js - pm2安装结果出错

标签 node.js npm ubuntu-14.04

我想全局安装 pm2 来运行我的 Nodejs 应用程序。我的操作系统是 ubuntu 14.04 64 位和 Node 版本 0.10.33。

当我运行命令 npm install pm2 -g 时,出现以下错误

npm ERR! pm2@0.11.1 preinstall: `bash ./scripts/preinstall.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pm2@0.11.1 preinstall script.
npm ERR! This is most likely a problem with the pm2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bash ./scripts/preinstall.sh
npm ERR! You can get their info via:
npm ERR!     npm owner ls pm2
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pm2" "-g"
npm ERR! cwd /home/ubuntu
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
ubuntu@ip-172-31-40-58:~$ 

最佳答案

尝试添加sudo

sudo npm install pm2 -g

sudo npm install pm2 -g --unsafe-perm

关于node.js - pm2安装结果出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26731308/

相关文章:

Ubuntu 14.04 上的 MySQL 5.5 和 SSL

node.js - 将数据传递到 Express 中的 View

javascript - 使用查询字符串的终极搜索

javascript - NPM 包 : Rename package directory

linux - 如何从 vsts 中的 linux 托管代理输出 npm 构建错误日志文件?

java - 物理内存使用率过高

python - 无法在新的 ubuntu 笔记本电脑中正确安装 python 包

node.js - NodeJS module.exports 没有按预期工作

node.js - 如何在所有文件的 express.js 4.x 上启用 CORS?

gradle - 将JHipster应用程序转换为gradle,现在在dev中返回空白页