v1.9.2: EACCESS error on first install #102

Closed
zkat opened this Issue Sep 10, 2013 · 13 comments

Projects

None yet

9 participants

@zkat

I installed phantomjs@1.9.2-0 globally with npm and got an error when I tried to run it as a user.

Steps:

  • $ sudo npm install -g phantomjs@1.9.2-0
  • $ phantomjs

Results:

Error executing phantom at /opt/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs
Error: spawn EACCES
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)
execvp(): Permission denied

Notes

However, this works:

$ sudo phantomjs
2013-09-10 16:14:04.943 phantomjs[25505:707] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. 
phantomjs> ^D
$ phantomjs
2013-09-10 16:15:05.790 phantomjs[25510:707] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. 
phantomjs>

I can execute phantomjs normally from then on, without any problems.

I tested this phantomjs@1.9.1-0, and didn't get this error.

@emirotin

+1 for the problem and for the work-around
Thanks @sykopomp

@gmcguire

+1, for me at least, this seems to be an OS X 10.8 -> 10.9 (Mavericks) upgrade issue.

@dpup
Medium member

Works fine for me on mavericks. What's the exact error you are seeing.

@gmcguire

Running PhantomJS via Karma:

Running "karma:unit-continuous" (karma) task
INFO [karma]: Karma server started at http://localhost:11080/__testacular/
INFO [launcher]: Starting browser PhantomJS
ERROR [launcher]: Cannot start PhantomJS
    Error: spawn EACCES
INFO [launcher]: Trying to start PhantomJS again.
ERROR [launcher]: Cannot start PhantomJS
    Error: spawn EACCES
INFO [launcher]: Trying to start PhantomJS again.
ERROR [launcher]: Cannot start PhantomJS
    Error: spawn EACCES
Warning: Task "karma:unit-continuous" failed. Use --force to continue.

Then load the console:

greg$ sudo phantomjs 
phantomjs> ^D 

Then Karma is able to load PhantomJS:

Running "karma:unit-continuous" (karma) task
INFO [karma]: Karma server started at http://localhost:11080/__testacular/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9 (Mac)]: Connected on socket id fMYJPR3jnv3PoSNiFmUd
........................................
PhantomJS 1.9 (Mac): Executed 40 of 40 SUCCESS (0.497 secs / 0.252 secs)

Done, without errors.

Using karma@0.10.2, karma-phantomjs-launcher@0.1.0, phantomjs@1.9.2-2. Do you think this an npm and/or Mavericks issue and not phantomjs?

@dpup
Medium member

If you run phantomjs without sudo it also fails?

@gmcguire

Yes, it gave me the same error as @sykopomp. Once I ran it once under sudo it runs fine as me. I confirmed I am the file's owner and it has permissions 755. This seems more like an OS X issue frankly.

@dpup
Medium member
@spwizard

Running OSX 10.9 and have the same issue, launch with sudo and all is fine, thats an hour I'll never get back ;)

@PunkChameleon

Having this issue as well. Is there any workaround? I want to automate something and have it work OS-agnostic so we can't run sudo everytime :(

@seanislegend

+1 only works with sudo.

@ykt

The problem seems because it is installed in the not writable folder. Another workaround that works for me is having phantomjs installed in the writable folder, e.g.:

setenv PATH "`echo $PATH`:./node_modules/phantomjs/bin/"
@sindresorhus sindresorhus referenced this issue in sindresorhus/pageres Feb 26, 2014
Closed

Error: spawn EACCES #54

@rtkpmcalpine

If I just run it once with sudo it works after that. I'm just running this after I install it:
sudo phantomjs --version

@hasselg hasselg referenced this issue in GitbookIO/gitbook-pdf Apr 20, 2014
Closed

PDF creation hanging indefinitely #5

@dpup
Medium member

I don't have enough information to fix this so am going to close. If any of you can isolate the issue and propose a patch I'd happily review.

@dpup dpup closed this May 23, 2014
@etiennebr etiennebr referenced this issue in karma-runner/karma Dec 20, 2014
Closed

Cannot start PhantomJS #1270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment