我想全局安装pm2来运行我的nodejs应用程序。我的操作系统是ubuntu 14.04 64位,节点版本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:~$
答案 0 :(得分:1)
尝试添加 sudo
sudo npm install pm2 -g
或
sudo npm install pm2 -g --unsafe-perm