https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245
Some npm plugins need node-gyp
to be installed.
However, node-gyp
has it's own dependencies (from the github page):
If you're using Windows you can now install all node-gyp
dependencies with single command (NOTE: Run As Admin in Windows PowerShell):
$ npm install --global --production windows-build-tools
and then install the package
$ npm install --global node-gyp
https://github.com/nodejs/node-gyp/issues/809#issuecomment-155019383
Delete your $HOME/.node-gyp directory and try again.
See full documentation here: node-gyp
Make sure you have all the required software to run node-gyp
:
You can configure version of Visual Studio used by node-gyp
via an environment variable so you can avoid having to set the --msvs_version=2012
property every time you do an npm install.
Examples:
GYP_MSVS_VERSION=2012
for Visual Studio 2012 GYP_MSVS_VERSION=2013e
(the 'e' stands for FREE 'express edition') For the full list see - https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294
This is still painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed and many end users will never have this. So I'm lobbying Joyent to the encourage them to include web sockets as part of CORE node and also to possible ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.
Feel free to add your vote at:
I encountered the issue with the error:
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
Here is what I was doing and what finally worked.
Disclaimer: I am just getting my hands into Node, Angular after many years in the Java, Linux world among others...
Environment Description: Windows 8.1 64-bit; Cygwin; cygwin bash shell
Command used that led to error: npm install -g karma
Error: gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT HON env variable.
Discovery: 'which python' on bash shell clearly shows '/usr/bin/python'. Now that is annoying!
Solution: This is only applicable to those using the environment similar to what I have, i.e. using cygwin and bash shell. Hope it helps in other environments as well but keep in mind that your kettle of tea may look a little different than mine.
export PYTHON="C:/cygwin64/bin/python2.7.exe (or whatever is the version on your system)"
You should be fine now and gyp will find the python executable.
I hope this helps someone stumbling on the same or similar issue.
should be able get all node-gyp dependencies with chocolatey for Windows
choco install python2
choco install visualstudioexpress2013windowsdesktop
Download installer at NodeJs website. You can download the latest V6
Npm is installed together with Node.js. So don't worry.
Anaconda is the leading open data science platform powered by Python. The open source version of Anaconda is a high performance distribution of Python. It can help you to manage your python dependency. You can use it to create different python environment in the futher if you want to touch with it.
Node-gyp only support >= Python 2.7 and < Python 3.0
So just install the 2.7 version
You can install with npm
:
$ npm install -g node-gyp
You will also need to install:
On Windows:
Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools
from an elevated PowerShell or CMD.exe (run as Administrator).
Option 2: Install tools and configuration manually:
Visual C++ Build Environment:
💡 [Windows Vista / 7 only] requires .NET Framework 4.5.1
Launch cmd, npm config set msvs_version 2015
If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips.
If you have multiple Python versions installed, you can identify which Python version node-gyp
uses by setting the '--python' variable:
$ node-gyp --python C:/Anaconda2/python.exe
If node-gyp
is called by way of npm
and you have multiple versions of Python installed, then you can set npm
's 'python' config key to the appropriate value:
$ npm config set python C:/Anaconda2/python.exe
Download installer from their official website and direct install it. The installer will automatic help you to remove old files.
npm update npm
conda update --all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With