我在Ubuntu 14.04上设置PhantomJS时出现问题,我使用NPM进行安装但是它不起作用,安装停止在" 70%" ...
命令:sudo npm install phantomjs --save
> phantomjs@1.9.17 install /var/www/gestiaweb/GestionDettes.3000/node_modules/phantomjs > node install.js Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 Saving to /var/www/gestiaweb/GestionDettes.3000/node_modules/phantomjs/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2 Receiving... [============================------------] 70% 0.0s Received 12854K total. Extracting tar contents (via spawned process) Removing /var/www/gestiaweb/GestionDettes.3000/node_modules/phantomjs/lib/phantom Copying extracted folder /var/www/gestiaweb/GestionDettes.3000/node_modules/phantomjs/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1435657830806/phantomjs-1.9.8-linux-x86_64 -> /var/www/gestiaweb/GestionDettes.3000/node_modules/phantomjs/lib/phantom Writing location.js file Done. Phantomjs binary available at /var/www/gestiaweb/GestionDettes.3000/node_modules/phantomjs/lib/phantom/bin/phantomjs phantomjs@1.9.17 node_modules/phantomjs ├── which@1.0.9 ├── progress@1.1.8 ├── kew@0.4.0 ├── request-progress@0.3.1 (throttleit@0.0.2) ├── adm-zip@0.4.4 ├── npmconf@2.1.1 (ini@1.3.4, uid-number@0.0.5, inherits@2.0.1, once@1.3.2, osenv@0.1.3, config-chain@1.1.9, nopt@3.0.3, semver@4.3.6, mkdirp@0.5.1) └── request@2.42.0 (caseless@0.6.0, forever-agent@0.5.2, aws-sign2@0.5.0, stringstream@0.0.4, oauth-sign@0.4.0, tunnel-agent@0.4.0, json-stringify-safe@5.0.1, qs@1.2.2, node-uuid@1.4.3, mime-types@1.0.2, form-data@0.1.4, bl@0.9.4, http-signature@0.10.1, tough-cookie@2.0.0, hawk@1.1.1) icecom@web-test:/var/www/gestiaweb/GestionDettes.3000$
答案 0 :(得分:3)
将可执行文件放入PATH中的目录(或将符号链接放入PATH)或让NPM全局安装:
npm -g install phantomjs