设置npm源
young / / npm / 阅读量

原始源

# the original source
https://registry.npmjs.org/
  • 设置成淘宝源
npm config set registry https://registry.npm.taobao.org
  • 查看结果
npm config get registry

输出结果:

https://registry.npm.taobao.org/
  • 测试一下
npm info underscore

命令行指定源

npm --registry https://registry.npm.taobao.org install [name]

修改 ~/.npmrc

registry = https://registry.npm.taobao.org

使用cnpm

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

参照

淘宝源链接

支付宝捐赠
请使用支付宝扫一扫进行捐赠
微信捐赠
请使用微信扫一扫进行赞赏
有 0 篇文章