国外地址换成国内地址(阿里)
npm config set registry http://registry.npm.taobao.org
yarn config set registry https://registry.npm.taobao.org
和cnpm区别
cnpm安装的包看着乱七八糟的,路径可能会乱,直接改npm地址就不不会存在这个问题
带来的新问题
发布npm包时候会失败
需要改回去再发布(哈哈哈哈~~~)
npm config set registry https://registry.npmjs.org
yarn config set registry https://registry.yarnpkg.com
方便快速切换地址的工具 [nrm]
安装
npm i nrm -g
使用
nrm ls 查看可切换的地址列表和当前处于哪个地址
nrm use [name] 切换至改地址