ZhengXingchi / ZhengXingchi.github.io

Apache License 2.0
0 stars 0 forks source link

node npm的一些操作 #86

Open ZhengXingchi opened 4 years ago

ZhengXingchi commented 4 years ago

切换npm源

参考npm太慢, 淘宝npm镜像使用方法 1.全局安装淘宝镜像源 : npm install -g cnpm registry=https://registry.npm.taobao.org 通过cnpm 指令代替 npm

2.配置一下npm的registray地址: npm config set registry https://registry.npm.taobao.org 验证是否更改成功: npm config get registry 会直接打印淘宝镜像的地址:https:registry.npm.taobao.org 使用npm 指令的镜像源也是淘宝镜像, 此方法不用cnpm指令

3.通过全局安装nrm : npm install -g nrm 输出不同的镜像源: nrm ls 切换淘宝镜像源: nrm use taobao

  1. 临时使用淘宝源 npm --registry https://registry.npm.taobao.org install express
ZhengXingchi commented 4 years ago

nrm的使用

参考nrm安装与使用

ZhengXingchi commented 4 years ago

n的使用

参考node 版本切换工具 n 的使用