常用的npm的packages mirror配置
chrome driver
1
2
3
4
5# 安装指定地址
npm install chromedriver --chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver
# 直接设置`.npmrc`变量
npm config set chromedriver_cdnurl "https://npm.taobao.org/mirrors/chromedriver"1
2# 添加环境变量 CHROMEDRIVER_CDNURL
CHROMEDRIVER_CDNURL=https://npm.taobao.org/mirrors/chromedriver npm install chromedriverelectron
1
2
3
4npm config set electron_mirror https://npm.taobao.org/mirrors/electron/
# 或者
ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" npm i electronphantomjs
1
2
3
4
5
6
7npm install phantomjs-prebuilt --phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
# .npmrc 方式
npm config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/
# PATH
PHANTOMJS_CDNURL=https://npm.taobao.org/mirrors/phantomjs/node-sass
1
2
3npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
# .npmrc
npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/