美文网首页
cnpm淘宝镜像的安装和使用方法

cnpm淘宝镜像的安装和使用方法

作者: 宏_4491 | 来源:发表于2020-10-14 10:15 被阅读0次

npm全称Node Package Manager,是node.js的模块依赖管理工具。由于npm的源在国外,所以国内用户使用起来各种不方便。下面整理出了一部分国内优秀的npm镜像资源,国内用户可以选择使用。

以淘宝npm镜像举例:

  • 临时使用
npm --registry https://registry.npm.taobao.org install express
  • 持久使用
npm config set registry https://registry.npm.taobao.org
  • 配置后可通过下面方式来验证是否成功
npm config get registry
//或者
npm info express

通过cnpm使用,也是常用推荐的方法

npm install -g cnpm --registry=https://registry.npm.taobao.org
  • 安装后校验的方法
cnpm install express

相关文章

网友评论

      本文标题:cnpm淘宝镜像的安装和使用方法

      本文链接:https://www.haomeiwen.com/subject/nhczsktx.html