1

我的CI構建保持與失敗:到位桶限速phantomjs

> [email protected] install /home/travis/build/redgeoff/paste-image/node_modules/mocha-phantomjs/node_modules/phantomjs 
> node install.js 
PhantomJS detected, but wrong version 1.9.8 @ /usr/local/phantomjs/bin/phantomjs. 
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 
Saving to /tmp/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2 
Receiving... 

Error requesting archive. 
Status: 403 
Request options: { 
    "uri": "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2", 
    "encoding": null, 
    "followRedirect": true, 
    "headers": {}, 
    "strictSSL": true 
} 
Response headers: { 
    "x-amz-request-id": "31FE6AEAF3807721", 
    "x-amz-id-2": "ePama6pBgS1VdgDLGaFpUxLSmqkm0KJ/mflR8jUU28aPteacBzcKHeoQf18F+Sz7KKrn5UzGMVE=", 
    "content-type": "application/xml", 
    "transfer-encoding": "chunked", 
    "date": "Fri, 16 Sep 2016 06:56:57 GMT", 
    "server": "AmazonS3" 
} 
Make sure your network and proxy settings are correct. 

這似乎是由於速率限制bitbucket.org。我怎樣才能防止這些錯誤?

回答

0

只需將鏈接導出到不同的二進制位置,例如export PHANTOMJS_CDNURL=http://cnpmjs.org/downloads

例如,如果你正在使用TravisCI你可以使用:

global: 
    - PHANTOMJS_CDNURL=http://cnpmjs.org/downloads 

在CircleCI,您可以使用以下命令:

machine: 

    environment: 
    # Use a CDN to prevent bitbucket rate limits when downloading phantomjs 
    PHANTOMJS_CDNURL: http://cnpmjs.org/downloads