Cannot start PhantomJS
See original GitHub issueHello, this seems to be somewhat related to issue #558. However I’m new to all this (npm, grunt, karma) and I’m not really sure of the identity of the problem.
When I
grunt karma:unit
I get this sad result
Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.28 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
ERROR [launcher]: Cannot start PhantomJS
Error: spawn EACCES
INFO [launcher]: Trying to start PhantomJS again (1/2).
ERROR [launcher]: Cannot start PhantomJS
Error: spawn EACCES
INFO [launcher]: Trying to start PhantomJS again (2/2).
ERROR [launcher]: Cannot start PhantomJS
Error: spawn EACCES
ERROR [launcher]: PhantomJS failed 2 times (cannot start). Giving up.
Warning: Task "karma:unit" failed. Use --force to continue.
Aborted due to warnings.
With my limited understanding I’ve tried installing and reinstalling (global and/or not) phantomjs but it didn’t work out.
I’m on Ubuntu 12.04 karma@0.12.28 node@0.10.34 phantomjs@1.9.12
However, when I $ phantomjs --version
, I get 1.9.8
. which is odd. Checking on the phantomjs website seems to confirm the latests release is phantomjs 1.9.8.
$ npm remove phantomjs -g
unbuild phantomjs@1.9.12
$ npm remove phantomjs
unbuild phantomjs@1.9.12
$ phantomjs --version
bash: ~/.npm-packages/bin/phantomjs: No such file or directory
So I don’t think there’s another installation that karma could refer to. At this point, when I launch grunt karma:unit it accordingly say that phantomjs isn’t there.
Then I reinstalled phantomjs
$ npm install phantomjs
> phantomjs@1.9.12 install ~/mytodo/node_modules/phantomjs
> node install.js
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
[======================================--] 95% 0.0s
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /media/Fermi/workspace/mytodo/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1418991182513/phantomjs-1.9.8-linux-x86_64 -> ~/mytodo/node_modules/phantomjs/lib/phantom
Removing /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1418991182513
Writing location.js file
Done. Phantomjs binary available at ~/mytodo/node_modules/phantomjs/lib/phantom/bin/phantomjs
phantomjs@1.9.12 node_modules/phantomjs
├── which@1.0.8
├── progress@1.1.8
├── rimraf@2.2.8
├── ncp@1.0.1
├── kew@0.4.0
├── adm-zip@0.4.4
├── request-progress@0.3.1 (throttleit@0.0.2)
├── mkdirp@0.5.0 (minimist@0.0.8)
├── npmconf@2.0.9 (uid-number@0.0.5, inherits@2.0.1, osenv@0.1.0, ini@1.3.2, once@1.3.1, semver@4.1.0, nopt@3.0.1, config-chain@1.1.8)
└── request@2.42.0 (caseless@0.6.0, json-stringify-safe@5.0.0, aws-sign2@0.5.0, forever-agent@0.5.2, stringstream@0.0.4, oauth-sign@0.4.0, tunnel-agent@0.4.0, qs@1.2.2, node-uuid@1.4.2, mime-types@1.0.2, tough-cookie@0.12.1, http-signature@0.10.0, form-data@0.1.4, bl@0.9.3, hawk@1.1.1)
Still, karma complains Cannot start PhantomJS Error: spawn EACCES
.
Issue Analytics
- State:
- Created 9 years ago
- Comments:21 (6 by maintainers)
Top GitHub Comments
Just wanted to note, as I had a similar issue today - phantomjs on Ubuntu needs the
libfontconfig
package (and/or thelibfontconfig-dev
package - I installed both) or it won’t start…RHEL/CentOS solution: