增加个pm2用户:

groupadd pm2  
useradd -m -s /bin/bash -g pm2 pm2  

clone整个nvm项目

sudo su - pm2  
git clone https://github.com/creationix/nvm.git ~/.nvm  
cat<EOF>>~/.bashrc  
export NVM_DIR="/home/pm2/.nvm"  
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
EOF  
source ~/.bashrc  

安装node

nvm list  
nvm install v4.4.7  
npm i pm2 -g  
comments powered by Disqus