Npm 设置国内镜象

镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在):

1.通过config命令
npm config set registry https://registry.npmmirror.com
npm info underscore (如果上面配置正确这个命令会有字符串response)

2.命令行指定
npm --registry https://registry.npm.taobao.org info underscore 

3.编辑 ~/.npmrc 加入下面内容
registry = https://registry.npmmirror.com

查看配置 
blob.png

修改时间 2024-09-06

声明:本站所有文章和图片,如无特殊说明,均为原创发布,转载请注明出处。
随机推荐
JavaScript 基本语法
JavaScript 对象方法
Node.js os 模块
Node.js http 模块
Wordpress 使用 tag 标签获取文章列表的方法
Nine 主题
WordPress 常用接口
JavaScript 使用 html2canvas 生成图片