Skip to content

Instantly share code, notes, and snippets.

@rozeappletree
Created July 27, 2020 14:12
Show Gist options
  • Save rozeappletree/49da21544457528f108ea1ae1236caa1 to your computer and use it in GitHub Desktop.
Save rozeappletree/49da21544457528f108ea1ae1236caa1 to your computer and use it in GitHub Desktop.
The cleanest way to achieve this would be to symlink the binary in the /usr/local/bin directory (which is included in PATH by default). You might need to create this directory if it doesn't exist yet. You can check to see if these directories are already in your PATH by opening Terminal.app and typing:
echo $PATH
This will generate a colon delimited listing of all directories in your PATH.
If the directories /usr/local or /usr/local/bin do not exist yet, execute the following:
sudo mkdir -p /usr/local/bin
Symlink the binary, replace (/Applications) with the path to phantomjs.app if it differs:
sudo ln -s /Applications/phantomjs.app/Contents/MacOS/phantomjs /usr/local/bin
Now you should have no problems executing phantomjs from the command-line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment