NODEJS安装指定版本

NODEJS安装指定版本

sudo apt-get install -y build-essential
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
## Node.js v20.x  curl -fsSL https://rpm.nodesource.com/setup_20.x |sudo -E bash -
## Node.js LTS (18.x) curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo apt-get install -y nodejs

NPM仓库地址变更

1.得到原本的镜像地址

npm get registry

https://registry.npmjs.org/

设成淘宝的

npm config set registry http://registry.npm.taobao.org/

yarn config set registry http://registry.npm.taobao.org/

2.换成原来的

npm config set registry https://registry.npmjs.org/