npm config set registry https://registry.npm.taobao.org
配置后可通过下面两种方式来验证是否成功
1
2
3
4
[[方法一:]]
npm config get registry
[[方法二:]]
npm info express
3. 配置其他模块
1
2
3
4
5
6
7
8
npm config set registry https://repo.huaweicloud.com/repository/npm/
npm config set disturl https://repo.huaweicloud.com/nodejs
npm config set sass_binary_site https://repo.huaweicloud.com/node-sass
npm config set phantomjs_cdnurl https://repo.huaweicloud.com/phantomjs
npm config set chromedriver_cdnurl https://repo.huaweicloud.com/chromedriver
npm config set operadriver_cdnurl https://repo.huaweicloud.com/operadriver
npm config set electron_mirror https://repo.huaweicloud.com/electron/
npm config set python_mirror https://repo.huaweicloud.com/python
yarn config set registry https://registry.npm.taobao.org
yarn config set disturl https://npm.taobao.org/dist
yarn config set sass-binary-site https://npm.taobao.org/mirrors/node-sass
npm 华为云配置
1
2
3
4
5
6
7
8
npm config set registry https://repo.huaweicloud.com/repository/npm/
npm config set disturl https://repo.huaweicloud.com/nodejs
npm config set sass_binary_site https://repo.huaweicloud.com/node-sass
npm config set phantomjs_cdnurl https://repo.huaweicloud.com/phantomjs
npm config set chromedriver_cdnurl https://repo.huaweicloud.com/chromedriver
npm config set operadriver_cdnurl https://repo.huaweicloud.com/operadriver
npm config set electron_mirror https://repo.huaweicloud.com/electron/
npm config set python_mirror https://repo.huaweicloud.com/python