官方查看有哪些版本,查找自己想要的nodejs源

https://github.com/nodesource/distributions

centOS 通过yum 安装nodejs和npm

 

 

 

比如我安装14.x

centOS 通过yum 安装nodejs和npm

 

 

先安装源:

curl -sL https://rpm.nodesource.com/setup_14.x | bash -

centOS 通过yum 安装nodejs和npm

 

 

然后:

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

 

相关文章:

  • 2021-09-23
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2022-02-28
猜你喜欢
  • 2021-08-13
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-08-08
  • 2021-11-19
相关资源
相似解决方案