npm淘宝镜像的使用
创建时间:2022-08-16 17:37:37
栏目:前端
淘宝源的域名已经更换。原有的taobao.org会停止解析,请使用新的域名。
https://npm.taobao.org => https://npmmirror.com
https://registry.npm.taobao.org => https://registry.npmmirror.com
npm设置taobao为下载源。
#默认值为https://registry.npmjs.org/
npm config set registry https://registry.npmmirror.com
npm设置node_sass安装源
npm config set sass_binary_site https://npmmirror.com/mirrors/node-sass/
nvm设置node和npm下载源(此为nvm安装npm本身包的源)。
#配置下载node版本的地址(默认地址:https://nodejs.org/dist/)
nvm node_mirror https://npmmirror.com/mirrors/node/
#配置npm的地址(默认地址:https://github.com/npm/npm/archive/)
nvm npm_mirror https://npmmirror.com/mirrors/npm/
如果不行,请直接修改NVM_NODEJS_ORG_MIRROR
NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node/
export NVM_NODEJS_ORG_MIRROR
npm设置election镜像
npm config set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
npm config set electron_builder_binaries_mirror https://mirrors.huaweicloud.com/electron-builder-binaries/