使用非官方 NPM 镜像

直接修改全局默认镜像地址

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

以上配置相当于在 ~/.npmrc 中添加了 registry = https://registry.npm.taobao.org

在每次使用 npm 指令时指定镜像地址

如:

npm --registry https://registry.npm.taobao.org info underscore 

使用淘宝定制的 cnpm 代替默认的 npm 指令

npm install -g cnpm --registry=https://registry.npm.taobao.org

你可能感兴趣的:(使用非官方 NPM 镜像)