2016-02-05 86 views
1

下面FreeBSD的phantomJS安装问题

[email protected]:/data/www/node # npm i phantomjs 

运行命令后,我得到

npm WARN deprecated [email protected]: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt' 

> [email protected] 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 [email protected] 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 

这似乎是安装phantomjs,但是当我试图让phantomjs版本

[email protected]:/data/www/node # phantomjs --version 

我得到这个

/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 
[email protected]:/data/www/node # 

有谁知道如何解决这个问题?我需要运行应该使用Node.js的phantom.JS服务器,但磨它的预期是在使用我得到一个错误

[Error: PhantomJS exited with return value 2] 

回答

0

你已经运行到节点包管理器的一个众所周知的缺陷/ phantomjs的NPM包 - 它的安装,即使你正在运行FreeBSD phantomjs的Mac OS X版本:

> [email protected] install /data/www/node/node_modules/phantomjs 
> node install.js 
... 
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip 

看到这个phantomJS问题:

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

或者,您可以从源代码安装phantomjs; FreeBSD有一个端口来做到这一点:

masheen(~) # cd /usr/ports/lang/phantomjs 
masheen(~) # make install