npm install jsdom error on windows?

Jrubins picture Jrubins · Apr 2, 2012 · Viewed 14k times · Source

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?

Answer

Quantamax picture Quantamax · Feb 10, 2013

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.