Linux或Windows下配置npm源的三种方式

配置npm源

  • 临时使用,安装包的时候通过–registry参数即可
npm install express --registry https://registry.npm.taobao.org
  • 全局使用
    把npm的镜像源换成淘宝的镜像源
npm install set set registry https://registry.npm.taobao.org
//配置后可通过下面方式验证是否成功
npm config get registry
或
npm info express
  • cnpm 使用
//安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
//使用cnpm安装包
cnpm install express
发布了150 篇原创文章 · 获赞 11 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_41684621/article/details/103548569