配置文件
在 C:\Users\liteng 目录下创建文件 .npmrc ,填写以下内容:
cache=D:\\temp\\npm-cache
registry=https://registry.npmmirror.com
disturl=https://registry.npmmirror.com/node
ELECTRON_MIRROR=https://registry.npmmirror.com/electron
sass_binary_site=https://registry.npmmirror.com/node-sass
使用教程
常见问题
1、https:~/~/registry.npm.taobao.org/yorkie/download/yorkie-2.0.0.tgz failed, reason: certificate has expired。
原来使用的淘宝镜像是registry.npm.taobao.org,现在已经变成了registry.npmmirror.com,所以需要将下载镜像换成新的地址。执行下面命令:
npm cache clean --force
npm config set registry https://registry.npmmirror.com
npm config list
修改package-lock.json中的地址,把registry.npm.taobao.org替换成registry.npmmirror.com。