CentOS 7安装npm

wget https://nodejs.org/dist/v12.18.3/node-v12.18.3-linux-x64.tar.xz

tar -xvf node-v12.18.3-linux-x64.tar.xz -C .
mv node-v12.18.3-linux-x64 /usr/local/node

vim /etc/profile
Add:
#set for nodejs
export NODE_HOME=/usr/local/node
export PATH=$NODE_HOME/bin:$PATH

source /etc/profile
node -v
npm -v


设置镜像
npm config set registry https://registry.npm.taobao.org