Skip to content

Instantly share code, notes, and snippets.

@jtrefry
Last active September 6, 2023 07:30
Show Gist options
  • 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
@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