1. tar xvf node-v10.16.0-linux-x64.tar.xz // 解压node
2. cd /data/deploy/workspace/city-auth-manager/ //在云主机上创建一个目录
3. npm install pm2 -g //直接安装npm服务,
4. npm install // 安装npm
5. npm run start //npm 启动服务
6. ss -lnp |grep 3006 //开启端口
#####注意 这里是把node的环境变量加载进去
unset i unset -f pathmunge export JAVA_HOME=/home/gateway/java/jdk1.8.0_211 export CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tool.jar export PATH=$PATH:$JAVA_HOME/bin:/usr/python37/bin export HISTORY_FILE=/var/log/usermonitor/usermonitor.log export PROMPT_COMMAND='{ date "+%F %T $(who am i |awk "{print $1" "$5}") $(id|awk "{print $1}") $(history 1 | { read x cmd; echo "$cmd"; })"; } >>$HISTORY_FILE' export NODE_HOME=/root/node-v10.16.0-linux-x64/ export PATH=$PATH:$NODE_HOME/bin