Skip to content

Instantly share code, notes, and snippets.

@jtrefry
Last active September 6, 2023 07:30
Show Gist options
  • Star 55 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save jtrefry/fd0ea70a89e2c3b7779c to your computer and use it in GitHub Desktop.
Save jtrefry/fd0ea70a89e2c3b7779c to your computer and use it in GitHub Desktop.
Configuring Windows 10 (64-bit) for npm and node-gyp
  • Install Git for Windows
  • Install Node
  • Install Python 2.7.3
  • Install Microsoft Visual Studio 2015 Community
  • Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
    • npm install -g npm
      • (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
    • setx PYTHON C:\Python27\python.exe /m
      • (May need to change path to your custom install directory.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypassed one of the most frustrating experiences for npm users on Windows.
    • npm install -g node-gyp
    • npm install -g socket.io
@archiej
Copy link

archiej commented Mar 29, 2016

Thanks! This really helped for setting up my windows dev environment on my mac.

@jdpigeon
Copy link

Magnificent

@Dillenger69
Copy link

Holy Crap! Thank YOU!!! I've been trying to get this to work for three days now, installing various MS SDKs and Visual studio versions. The ONLY thing that worked were the steps above with Microsoft Visual Studio 2015 Community. Someone should really address this as it seems to have been a problem for years and it will only get worse once that link above starts to fail.

@paulappwork
Copy link

THANK YOU SO MUCH. IT helped me out a lot as well!

@Calderis
Copy link

Thanks a lot! Always a pain in the ass to configure this. It once took me a full week to do this!

@MatthewEskolin
Copy link

Had a lot of trouble with this because I was trying to use the latest version of Python 3.7.3 - using 2.7.3 instead and everything worked. Windows 10 with Visual Studio 2019 Community

@AsherJacob
Copy link

i spent an entire day trying to configure this and i was really going crazy. Thanks a ton Mr.

@CyanoFresh
Copy link

don't know what exact step helped but it's working now. thanks

@manuelxtrem
Copy link

This solution came at the right time! I have been struggling with it for days. Thanks a lot

@astroame
Copy link

astroame commented Sep 9, 2019

Please can I use Microsoft Visual Studio 2015 as a replacement for Microsoft Visual Studio 2015 Community?

@floatzeI
Copy link

Doesn't work for me, I keep getting this:

gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1

if anyone manages to install it, please mention me :(

@SHREYASH-MUKESH
Copy link

worked for me thanks

@kiruh
Copy link

kiruh commented May 19, 2021

Doesn't work for me, I keep getting this:

gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1

if anyone manages to install it, please mention me :(

Have you found solution?

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