Quick writeup on how I do Node/npm on Windows.
- Install Git Bash (i.e. install Git for Windows, use the built-in Bash shell)
- Install windows-build-tools. Be sure to run in an elevated prompt in PowerShell (i.e. right click -> "run as administrator")
- Install Bash on Ubuntu on Windows
- Install Node/npm directly from nodejs.org
Use Git Bash for straightforward Node/npm development using only the latest version of Node. To test that it's working, try to install a bunch of tricky packages with native deps:
mkdir test
cd test
npm init -y
npm install --save leveldown sqlite3 phantomjs-prebuilt browserify watchify webpack react
I use Bash on Ubuntu on Windows for testing other versions of Node. You can install nvm exactly as if you were on Unix. I also use Bash on Ubuntu on Windows for publishing npm packages, since it avoids accidentally committing CRLF-formatted files.