安装node
wget https://registry.npmmirror.com/-/binary/node/latest-v14.x/node-v14.18.3-linux-x64.tar.gz
tar -zxvf node-v14.18.3-linux-x64.tar.gz
cd /usr/local
mv /root/node-v14.18.3-linux-x64 ./
mv node-v14.18.3-linux-x64 node
配置环境变量
vim /etc/profile
export NODE_HOME=/work/mySoft/node-v14.18.3-linux-x64
export PATH=$PATH:$NODE_HOME/bin
export NODE_HOME
source /etc/profile
设置淘宝源
npm config set registry http://registry.npm.taobao.org/
# 检查是否更换成功
npm config get registry
安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
验证是否安装成功
node -v
npm -v
cnpm -v
jenkins安装nodejs插件
全局工具配置