当前位置:   article > 正文

nodejs 国内镜像源_nodejs国内源

nodejs国内源

推荐使用阿里的镜像源

通过 config 命令配置

通过全局配置指定镜像源:

npm config set registry https://registry.npmmirror.com
  • 1

在安装模块的时候指定镜像源

# 使用npmmirror镜像源 安装 loaddash 模块
npm install loaddash --registry https://registry.npmmirror.com
  • 1
  • 2

编辑 ~/.npmrc加入下面内容

还可以通过配置文件指定全局配置镜像源

registry=https://registry.npmmirror.com
  • 1

使用 cnpm

如果你不想修改镜像源,每次安装过程时指定镜像源又嫌麻烦的话,可以安装 cnpm 这个模块,这样在之后安装模块的时候使用 cnpm命令代替 npm命令,同样能使用该镜像源。

npm install -g cnpm --registry=https://registry.npmmirror.com
  • 1

如果想要使用 https://registry.npmmirror.com镜像源搜索镜像的话可以访问:https://npmmirror.com

参考资料

npmmirror.com/
淘宝 NPM 镜像站域名切换

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/212339
推荐阅读
  

闽ICP备14008679号