1.进入服务器输入命令,下载node-v12.16.3-linux-x64
wget https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz
2.解压
tar -xvf node-v12.16.3-linux-x64.tar.xz
3.把解压包移到目录/usr/local/node/下
mv node-v12.16.3-linux-x64 /usr/local/node/
4.建立软连接,设置全局
ln -s /usr/local/node/bin/node /usr/local/bin/node
ln -s /usr/local/node/bin/npm /usr/local/bin/npm
ln -s /usr/local/node/bin/cnpm /usr/local/bin/cnpm
ln -s /usr/local/node/bin/pm2 /usr/local/bin/pm2
ln -s /usr/local/node/bin/pm2-dev /usr/local/bin/pm2-dev
ln -s /usr/local/node/bin/pm2-docker /usr/local/bin/pm2-docker
ln -s /usr/local/node/bin/pm2-runtime /usr/local/bin/pm2-runtime
安装 cnpm pm2
npm install -g cnpm –registry=https://registry.npm.taobao.org
cnpm install -g pm2
近期评论