I'm trying to install PhantomJS v2.0.0
using npm
and after trying a couple of methods I've not found a working solution...
On NPM the latest version is 1.9.16
, so I've tried the following in my package.json
:
"phantomjs": "https://github.com/ariya/phantomjs/archive/2.0.0.tar.gz"
This gives me an error because there isn't a package.json
for this version in the github repo.
"phantomjs": "2.0.0"
This tells me there is no version with this number available.
Am I missing something here?
For Windows Set the PATH environment variable to the path of phantom.exe file. Open a new command prompt and type phantomjs –v. It should give you the current version of PhantomJS that is running.
//use this if you installed with apt-get sudo apt-get remove phantomjs *remove the phantomjs rm /usr/bin/phantomjs *use this if the link didn't remove. //use this if you installed from npm: like this: npm install phantomjs rm -R /node_modules/phantomjs *note: it will be in other folder, search it.
phantomjs-prebuilt was renamed from phantomjs and now additionally contains binaries for version 2.1+.
npm -g install phantomjs-prebuilt
The fork phantomjs2 is still available which contains version 2.0.
npm -g install phantomjs2
Keep in mind that not all platforms might be supported.
Phantomjs may be installed as a brew package. Confirm this:
brew ls | grep phantomjs
If you do have phantomjs installed as a brew package, you can easily uninstall it:
brew uninstall phantomjs
Then try rerunning npm install
after updating your package.json for "2.0.0".
FYI: Please read semantic versioning: https://stackoverflow.com/a/22345808/3412545
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With