常用国内镜像

本文档旨在解决国内网络环境可能导致的超时问题。

PhantomJS

错误提示

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Receiving...

Error making request.
Error: connect ETIMEDOUT 52.216.225.200:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1173:14)

Please report this full log at https://github.com/Medium/phantomjs

解决方案:添加环境变量

ENV PHANTOMJS_CDNURL=http://npm.taobao.org/mirrors/phantomjs

Selenium

解决方案:添加环境变量

ENV SELENIUM_CDNURL=http://npm.taobao.org/mirrorss/selenium

electron

解决方案:添加环境变量

ENV ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/

chromedriver

解决方案:添加环境变量

ENV CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver

node-sass

错误提示

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.3/linux-x64-59_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.9.3/linux-x64-59_binding.node": 

ETIMEDOUT

Timed out attemping to establish a remote connection

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

解决方案:添加环境变量

ENV SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/