Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing PhantomJS 2 using NPM fails on Windows

I'm trying to install PhantomJS 2 for a project that requires support for mutation observers. When I use the following command:

npm install phantomjs2 --save-dev

I get the following error:

Unexpected platform or architecture: win32 x64
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the phantomjs2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs2
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install" "phantomjs2" "--save-dev"
npm ERR! cwd g:\Web\GitHub\pet
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     g:\Web\GitHub\pet\npm-debug.log
npm ERR! not ok code 0

I am using 64 bit Windows 7. Is PhantomJS 2 just not supported on my platform?

like image 315
user141350 Avatar asked Apr 19 '15 21:04

user141350


People also ask

Why is npm install failing?

The error in NPM, 'error package install failed, see above', can occur when the user creates a new project in Angular using Node. js using VS code. This means that NPM is corrupted in your system, and must reinstall NPM.

Why npm is not working on Windows?

If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).

How do I know if PhantomJS is installed on Windows?

Open a new command prompt and type phantomjs –v. It should give you the current version of PhantomJS that is running.


1 Answers

Yes, that package currently doesn't support installing PhantomJS 2 on Windows. Just download it from the official page and put the exe in a directory that is in the PATH.

like image 62
Artjom B. Avatar answered Oct 06 '22 05:10

Artjom B.