As outlined in the issues on github. It is a bit of a pain to build projects on Windows using node-gyp and Visual Studio 2015. I will go over how I go about setting up a development environment that can build projects and I will take one of my projects that has had a hard time building on Windows 10 and get it working.

Computer History

This isnt a clean workstation. I have been using Windows 7 Pro 64-bit on this computer since 2012 and I have had Node working and building projects on here for quite some time. After my upgrade to Windows 10 I could still build using Node 0.10 and Visual Studio Express 2013.

I use nodist so I went ahead and bumped my version to latest

$ nodist selfupdate
$ nodist latest
$ npm -g update

Issue from older NPM

I then tried to build my project using the npm install --msvs_version=2015 and I see the following on bcrypt.

And I download the community edition. Once the download completes I star the installation and select "Custom" from the install options.

Make sure to select the Visual C++ and Python Tools. You can see my complete list of selections in the following two images.

Now with the install underway this can anywhere from 30 minutes to 2 hours (dont ask me, ask microsoft) During that time I am going to work on getting the rest of our platform together. However, you can wait until it finishes if you prefer.

Next, I start the command prompt and return it to legacy mode (this helps Webstorm as well as npm)

This will install nodist to C:\nodist which we will use to obtain our node versions. (Of course you could also use the installer from the Node.js website. However for a development environment this makes much more sense.

Now we must add some envrionment variables to get nodist to work correctly. We need to add the following.

System -> Path we need to append ;C:\nodist\bin

System -> NODIST_PREFIX set to C:\nodist

To get to the interface to make these changes Right click on the Windows Icon at the bottom left, then click "System" next click "Advanced System Settings" and then finally click "Environment Variables"

After setting the environment variables we are get nodist initialized and get the latest version of node installed.

NOTE In my environment for some reason nodist did not download a complete copy of Node 4.1.2 when running nodist latest I had to go to C:\nodist\v and delete the 4.1.2 folder and run nodist latest again. After that it worked. There is an issue filed against this here: https://github.com/marcelklehr/nodist/issues/93

Now it is time to install NPM with the latest version. Right now nodist comes with version 1.4.6 which is too old to work with the latest versions of Node and Node-GYP. Thus, we must overlay the latest version on our system.

After downloading the ZIP I went to C:\nodist\bin\node_modules in Windows explorer and renamed npm to npm_old. Then I created a new folder at this location named npm. Then I extracted the zip to C:\nodist\bin\node_modules\npm This extracts a folder called npm-3.3.6 to the location. I had to go inside npm-3.3.6 and move all the files and folders to C:\nodist\bin\node_modules\npm.