0%

npm配置

npm设置缓存路径

1
npm config set prefix "D:/BlogGit/npmCache/npm_global"
2
npm config set cache "D:/BlogGit/npmCache/npm_cache"

使用淘宝镜像源安装cnmp

1
npm install -g cnpm --registry=https://registry.npm.taobao.org

更换为默认源

1
npm config set registry https://registry.npmjs.org

更换为淘宝镜像源:

1
npm config set registry https://registry.npm.taobao.org

配置后通过以下方法验证是否成功:

1
npm config get registry