我想全局安装 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/