Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install jsdom error on windows?

Tags:

node.js

npm

jsdom

I have installed nodejs on my windows pc. And it was working fine. But when I tried to install jsdom using "npm install jsdom" I was prompoted by this error.

node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild info it worked if it ends with ok
ERR! Error: Python does not seem to be installed
at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:78:14) at Object.oncomplete (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:66:11) ERR! not ok
npm WARN optional dependency failed, continuing [email protected]
[email protected] ./node_modules/jsdom
+-- [email protected] +-- [email protected]

Can anyone help me regarding this problem?

like image 251
Jrubins Avatar asked Apr 02 '12 02:04

Jrubins


People also ask

Why npm is not working on Windows?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.

What is Jsdom npm?

jsdom is a pure-JavaScript implementation of many web standards, notably the WHATWG DOM and HTML Standards, for use with Node. js. In general, the goal of the project is to emulate enough of a subset of a web browser to be useful for testing and scraping real-world web applications.

Why npm command is not working on CMD?

The error “npm is not recognized as an internal or external command” error may occur because either the npm is not installed or it is not added to the windows path. To resolve this error, the first solution is to install Node. js on Windows as Node. js is equipped with npm by default.


2 Answers

I had the same issue on Windows 7 (x64 Ultimate), after hours of search and trials, here is how I resolved it. Please follow the steps in the same exact order:

  1. Install Visual Studio 2010/2012 C++ (Express or higher)
  2. Install Windows SDK 7.1
  3. Install "Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1"
  4. Install GTK (C:\GTK)
  5. Install Python (C:\Python27)
  6. Install node.js (x86)
  7. Add [node.js] to path (C:\Program Files (x86)\nodejs\;)
  8. Add [python] to path (C:\Python27\;)
  9. Add [GTK] to path (C:\GTK\bin;)
  10. Add [WindowsSDKDir] System Variable pointing to "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin"
  11. Run "Windows SDK 7.1 Command Prompt" as Administrator
  12. Set environment to x86 using "setenv /x86"
  13. Change directory to "C:\Program Files (x86)\nodejs\"
  14. Run "npm install -g npm"
  15. Run "npm update -g npm"
  16. Run "npm install -g node-gyp"
  17. Run "node-gyp configure build"
  18. Run "npm install jsdom"
  19. Run "npm install ajax"
  20. Run "npm install http-server"
  21. Run "npm install jquery"
  22. Run "npm install xmlhttprequest"
  23. Run "npm update"

I hope this helps.

like image 71
Quantamax Avatar answered Sep 20 '22 19:09

Quantamax


There is a nice guide to getting JSDom working on Windows here: http://www.steveworkman.com/node-js/2012/installing-jsdom-on-windows/

like image 33
mr.freeze Avatar answered Sep 17 '22 19:09

mr.freeze