Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created July 27, 2016 14:04
Show Gist options
  • Save nolanlawson/43d01a5fb4c94b62e43edac31d8c4c69 to your computer and use it in GitHub Desktop.
Save nolanlawson/43d01a5fb4c94b62e43edac31d8c4c69 to your computer and use it in GitHub Desktop.
My Windows setup for Node/npm development

My Windows setup for Node/npm development

Quick writeup on how I do Node/npm on Windows.

Instructions

  1. Install Git Bash (i.e. install Git for Windows, use the built-in Bash shell)
  2. Install windows-build-tools. Be sure to run in an elevated prompt in PowerShell (i.e. right click -> "run as administrator")
  3. Install Bash on Ubuntu on Windows
  4. Install Node/npm directly from nodejs.org

Why

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment