官方查看有哪些版本,查找自己想要的nodejs源
https://github.com/nodesource/distributions
比如我安裝14.x
先安裝源:
curl -sL https://rpm.nodesource.com/setup_14.x | bash -
然后:
yum -y install nodejs
通過:node -v 和npm -v 查看版本,說明安裝成功
替換為淘寶NPM鏡像
首先我們可以查看原本的鏡像地址:
npm get registry https://registry.npmjs.org/
然后替換成淘寶的:
npm config set registry http://registry.npm.taobao.org/
如果想恢復原來的鏡像地址:
npm config set registry https://registry.npmjs.org/
如果用淘寶定制的cnpm工具來代替默認的npm:
npm install -g cnpm --registry=https://registry.npm.taobao.org