mrkeck Sharing the Love


Phantomjs – command not found

Using a Mac, downloaded the zip and unzipped. Then tried to run phantomjs but said "Command not found" eventhough I was in the directory. If I used ./phantomjs in the dir it worked fine. No idea why

Filed under: phantomJs Leave a comment
Comments (1) Trackbacks (0)
  1. If you are trying to run a binary on a OSX, it will search all of the directories listed in the PATH environment variable (and only those directories) for the binary. In order to run a command thats not in path you must specify the path to the binary. The ./ is the path to the phantomjs (with . being the folder you are currently in). In order to run a binary without the ./ you will need to put it in a directory that is listed in the PATH variable. You can find this by doing ‘echo $PATH’. Most of the time it is best to put it somewhere in the /usr directory like /usr/local/bin. So just ‘cp phantomjs /usr/local/bin’ and you should be good.

Leave a comment

No trackbacks yet.