首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FreeBSD phantomJS安装问题

FreeBSD phantomJS安装问题
EN

Stack Overflow用户
提问于 2016-02-05 15:53:33
回答 1查看 1.3K关注 0票数 1

在下面运行命令之后

代码语言:javascript
复制
root@hz:/data/www/node # npm i phantomjs

我得到了

代码语言:javascript
复制
npm WARN deprecated phantomjs@2.1.3: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'

> phantomjs@2.1.3 install /data/www/node/node_modules/phantomjs
> node install.js

Looks like an `npm install -g`; unable to check for already installed version.
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip
Saving to /data/www/node/node_modules/phantomjs/phantomjs/phantomjs-2.1.1-macosx.zip
Receiving...
  [=======================================-] 98%
Received 16746K total.
Extracting zip contents
Removing /data/www/node/node_modules/phantomjs/lib/phantom
Copying extracted folder /data/www/node/node_modules/phantomjs/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1454690434788/phantomjs-2.1.1-macosx -> /data/www/node/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /data/www/node/node_modules/phantomjs/lib/phantom/bin/phantomjs
npm ERR! FreeBSD 9.3-RELEASE
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "phantomjs"
npm ERR! node v5.4.1
npm ERR! npm  v2.14.7
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package handlebars@4.0.2 does not satisfy its siblings' peerDependencies requirements!

npm ERR! Please include the following file with any support request:
npm ERR!     /data/www/node/npm-debug.log

似乎要安装幻影,但当我试图获得幻影版本时

代码语言:javascript
复制
root@hz:/data/www/node # phantomjs --version

我明白了

代码语言:javascript
复制
/usr/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs: 1: Syntax error: Unterminated quoted string
/usr/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs: 1: Syntax error: Error in command substitution
root@hz:/data/www/node #

有人知道如何解决这个问题吗?我需要运行应该使用Node.JS的phantom.JS服务器,但是预期它会在use中运行--我得到了下一个错误

代码语言:javascript
复制
[Error: PhantomJS exited with return value 2]
EN

回答 1

Stack Overflow用户

发布于 2016-02-05 17:03:47

您已经遇到了节点包管理器/幻影‘s的NPM包的一个众所周知的bug --它正在安装macosx版本的幻影’s,即使您运行的是FreeBSD:

安装/数据/www/节点/节点_模块/体模>节点install.js正在下载https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip

请参阅此PhantomJS问题:

https://github.com/ariya/phantomjs/issues/12963

或者,您可以从源代码中安装幻影to;FreeBSD有一个端口可以这样做:

代码语言:javascript
复制
masheen(~) # cd /usr/ports/lang/phantomjs
masheen(~) # make install
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35228267

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档