npm install jsdom error on windows?
Problem
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?
Solution
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:
- Install Visual Studio 2010/2012 C++ (Express or higher)
- Install Windows SDK 7.1
- Install "Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1"
- Install GTK (C:\GTK)
- Install Python (C:\Python27)
- Install node.js (x86)
- Add [node.js] to path (C:\Program Files (x86)\nodejs\;)
- Add [python] to path (C:\Python27\;)
- Add [GTK] to path (C:\GTK\bin;)
- Add [WindowsSDKDir] System Variable pointing to "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin"
- Run "Windows SDK 7.1 Command Prompt" as Administrator
- Set environment to x86 using "setenv /x86"
- Change directory to "C:\Program Files (x86)\nodejs\"
- Run "npm install -g npm"
- Run "npm update -g npm"
- Run "npm install -g node-gyp"
- Run "node-gyp configure build"
- Run "npm install jsdom"
- Run "npm install ajax"
- Run "npm install http-server"
- Run "npm install jquery"
- Run "npm install xmlhttprequest"
- Run "npm update"
I hope this helps.
Discussion
View additional discussion.