修改源地址时,若加上--global,则为全局设置源地址;否则,仅当前项目生效
npm
- 查看当前源
npm config get registry
- 修改npm源为淘宝源
npm config set registry https://registry.npm.taobao.org
- 修改npm源为官方源
npm config set registry http://registry.npmjs.org
yarn
- 查看当前源
yarn config get registry
- 修改yarn源为taobao源
yarn config set registry https://registry.npm.taobao.org
- 修改yarn源为官方源
yarn config set registry https://registry.yarnpkg.com
网友评论