Alex Meub

Install JSDOM On Windows

JSDOM is an awesome node package for simulating a browser environment. It’s a NodeJS implementation of the DOM that makes it super easy to work with pages retrieved from the Internet. Unfortunately, JSDOM relies on a node package called Contextify that is difficult to get working in Windows.

Before beginning, make sure you’ve got the following installed on your system: * A recent copy of the x86 version of Node.js for Windows * Python 2.7 installed in C:\Python27 * Visual Studio 2012 C++ (Express or higher) installed

These are the steps I took to get it JSDOM installed. A lot of this has been taken from StackOverflow…

  1. Uninstall any/all Visual Studio 2010 Redistibutables

  2. Install Windows SDK 7.1

  3. Install Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1

  4. Add node.js and python to your path: C:\Program Files (x86)\nodejs\;C:\Python27\;

  5. Check to see where Windows SDK 7.1 was installed and add a System Variable called WindowsSDKDir for it. It will most likely be in: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin or C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\Bin.

  6. Run “Windows SDK 7.1 Command Prompt” as Administrator

  7. Run the following commands (the node-gyp configure build will probably fail at first, but the rebuild/reinstall should succeed):

bash setenv /x86 cd C:\Program Files (x86)\nodejs\ npm install -g npm npm update -g npm npm install -g node-gyp node-gyp configure build node-gyp rebuild --msvs_version=2012 npm install -g node-gyp npm install -g jsdom