1、下载node文件
https://nodejs.org/en/download/
2、启动centos容器
docker run -it -d --name CentOS centos:centos7
3、把node的文件放到容器里
mkdir /data/tools -p && cd /data/tools
mv node-v10.16.0-linux-x64 /usr/local/node-v10.16.0
# 修改 PATH
vi /etc/profile
export NODEJS=/usr/local/node-v10.16.0
export PATH=$PATH:$NODEJS/bin
source /etc/profile
npm 设置淘宝源
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
cnpm -v
参考: https://www.cnblogs.com/jack-zou/p/16528979.html
标签:node,npm,vue,centos,前端,registry,https,PATH From: https://www.cnblogs.com/kaibindirver/p/16784302.html