限制位桶速率的phantomjs [英] bitbucket rate limiting phantomjs

查看:126
本文介绍了限制位桶速率的phantomjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的CI构建始终失败:

My CI builds keep failing with:

> phantomjs@1.9.7-15 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上的速率限制所致.如何防止这些错误?

This appears to be due to rate limiting on bitbucket.org. How can I prevent these errors?

推荐答案

只需将链接导出到其他二进制位置,例如export PHANTOMJS_CDNURL=http://cnpmjs.org/downloads

Simply export a link to a different binary location, e.g. export PHANTOMJS_CDNURL=http://cnpmjs.org/downloads

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

For example, if you are using TravisCI you can use:

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

在CircleCI中,您可以使用以下内容:

In CircleCI, you can use the following:

machine:

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

这篇关于限制位桶速率的phantomjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆