Node.js 代理配置

npm 代理配置

npm config set proxy http://127.0.0.1:7890  # 设置代理

设置镜像

设置

npm config set registry https://registry.npmmirror.com/
yarn config set registry https://registry.npmmirror.com/
pnpm config set registry https://registry.npmmirror.com/

查看

npm config get registry
yarn config get registry
pnpm config get registry

常用二进制包镜像设置

npm set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass # node-sass 二进制包镜像
npm set chromedriver_cdnurl https://cdn.npmmirror.com/binaries/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://cdn.npmmirror.com/binaries/operadriver # operadriver 二进制包镜像
npm set phantomjs_cdnurl https://cdn.npmmirror.com/binaries/phantomjs # phantomjs 二进制包镜像
npm set fse_binary_host_mirror https://cdn.npmmirror.com/binaries/fsevents # fsevents 二进制包
npm set electron_mirror https://cdn.npmmirror.com/binaries/electron/ # electron 二进制包镜像

node-sass

npm config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass/
yarn config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass/
pnpm config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass/
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9