简体   繁体   English

无法安装phantomjs - 这是一个bitbucket问题?

[英]Cannot install phantomjs — Is it a bitbucket issue?

phantomjs fails to install. phantomjs无法安装。 Does the error indicate that bitbucket has a problem? 错误是否表明bitbucket有问题?

$ sudo npm install -g phantomjs
...
> phantomjs@1.9.7-6 install /usr/lib/node_modules/phantomjs
> node install.js

Looks like an `npm install -g`; unable to check for already installed version.
Downloading http://cdn.bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
Saving to /usr/lib/node_modules/phantomjs/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2
Receiving...
Error requesting archive.
Status: 403
Request options: {
  "protocol": "http:",
  "slashes": true,
  "auth": null,
  "host": "cdn.bitbucket.org",
  "port": null,
  "hostname": "cdn.bitbucket.org",
  "hash": null,
  "search": null,
  "query": null,
  "pathname": "/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2",
  "path": "/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2",
  "href": "http://cdn.bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2"
}
Response headers: {
  "content-type": "application/xml",
  "transfer-encoding": "chunked",
  "connection": "keep-alive",
  "date": "Fri, 23 May 2014 13:29:01 GMT",
  "server": "AmazonS3",
  "x-cache": "Error from cloudfront",
  "via": "1.1 73a3bce79e63d88b3a25c9ced0be16f5.cloudfront.net (CloudFront)",
  "x-amz-cf-id": "V06j38N_5EE5K5vPU1uj8ADZ7451C7zTZ-rqsn785PFU-6Sxu-KfiQ=="
}
Make sure your network and proxy settings are correct.
npm ERR! phantomjs@1.9.7-6 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs@1.9.7-6 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-61-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "phantomjs"
npm ERR! cwd /home/phil
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.10
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/phil/npm-debug.log
npm ERR! not ok code 0

Setting PHANTOMJS_CDNURL as mentioned on the phantom js npm page seems to work as a workaround. 幻像js npm页面上所述设置PHANTOMJS_CDNURL似乎可以解决方法。

PHANTOMJS_CDNURL=http://cnpmjs.org/downloads
npm install phantomjs

UPDATE: It has been fixed, but you have to upgrade phantomjs 更新:它已被修复,但你必须升级phantomjs

Source: https://github.com/Medium/phantomjs/issues/178 资料来源: https//github.com/Medium/phantomjs/issues/178

Some background: I ran into the same problem again on MacOS because it did not upgrade all package.json files. 一些背景:我在MacOS上再次遇到了同样的问题,因为它没有升级所有的package.json文件。

Also note that there are two phantomjs projects: 另请注意,有两个phantomjs项目:

  1. https://github.com/ariya/phantomjs (the main project) https://github.com/ariya/phantomjs (主要项目)
  2. https://github.com/Medium/phantomjs (NPM wrapper for installing phantomjs) https://github.com/Medium/phantomjs (用于安装phantomjs的NPM包装器)

The fix for the download issues concerns the npm wrapper. 下载问题的修复程序涉及npm包装器。


(Here comes my original post) (这是我的原帖)

$ wget http://cdn.bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
2014-05-23 15:41:41 ERROR 403: Forbidden.

I send an email to the maintainer (as suggested by the npm error message). 我发送电子邮件给维护者(如npm错误消息所示)。 Now, I think, we just have to sit it out. 现在,我想,我们只需要坐下来。

Update: github issue: https://github.com/ariya/phantomjs/issues/12260 更新:github问题: https//github.com/ariya/phantomjs/issues/12260

See on https://github.com/Medium/phantomjs Building and Installing 请参阅https://github.com/Medium/phantomjs 构建和安装

Update: before do anything try npm update 更新:在做任何事之前尝试npm update

export PHANTOMJS_CDNURL=http://cnpmjs.org/downloads npm install phantomjs
npm install -g phantomjs

The "npm install phantomjs" is required at the end of the export. 导出结束时需要“npm install phantomjs”。

Maybe you get the error again, so run npm update After all you can run eg karma start test/karma.conf.js 也许你再次得到错误,所以运行npm update毕竟你可以运行例如karma start test/karma.conf.js

As a temporary workaround, you can use an alternative installation. 作为临时解决方法,您可以使用备用安装。

http://phantomjs.org/download.html http://phantomjs.org/download.html

我遇到了这个问题并通过更新npm来解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM