node.jscasperjs

casperjs command not found


I installed phantomjs on my mac

 phantomjs --version
1.9.2

Following the instructions on the casper installation page, I did this

$ git clone git://github.com/n1k0/casperjs.git
$ cd casperjs
$ ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs

However, i'm getting command not found when I run casperjs. I also installed it via homebrew and got the same result.

Any suggestions?

Update

this is what I get when I type $PATH

-bash: /Users/me/.rbenv/shims:/opt/local/bin:/opt/local/sbin:/Users/me/downloads/mongodb-osx-x86_64-2.4.5/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin: No such file or directory

inside

usr/local/bin, there is (among other things) phantomjs and casperjs. I can run phantomjs --version from anywhere and get the version number. casperjs doesn't work


Solution

  • This is most likely due to the symbolic link not being created.

    Try running the command directly: /usr/local/bin/casperjs --version

    If this results in another Command not found error, then you should try running

    sudo ln -sf `pwd`/bin/casperjs /usr/local/bin/casperjs
    

    to make sure that you actually create the link in the /usr/local/bin directory

    However, if it does exist, you should check to make sure that the link is pointing to the correct directory by running

    ls -l /usr/local/bin/casperjs