npm 源地址设置及恢复

时间:2022-05-27 22:28:13   收藏:0   阅读:7

设置国内淘宝镜像

  1. 通过cnpm使用淘宝镜像:
npm install -g cnpm --registry=https://registry.npm.taobao.org
  1. 将npm设置为淘宝镜像:
npm config set registry https://registry.npm.taobao.org
  1. 查看当前npm源
npm config get registry 
  1. 查看当前cnpm源
cnpm config get registry  
  1. 如果设置了npm为淘宝镜像,需要恢复为默认源时:
npm config set registryhttps://registry.npmjs.org 

设置之后,记得通过npm config get registry 查看源是否设置成功

原文:https://www.cnblogs.com/uzi666/p/15350757.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!