npm - "Can't find Python executable "python", you can set the PYTHON env variable."

Nick picture Nick · Dec 19, 2015 · Viewed 117.4k times · Source

I'm trying to run the following command: npm install -g bower gulp cordova ionic tsd@next karma-cli protractor node-gyp coffee-script js-beautify typescript npm-check

I have installed Python, Visual Studio Express and node-gyp so thought I'd be good to go, however I get the following errors:

enter image description here

Regarding the "Can't find Python executable "python", you can set the PYTHON env variable." error, I'm a little confused because I have set the PYTHON environmental variable like so:

enter image description here

Any ideas please?

Answer

kuan tein picture kuan tein · Jan 30, 2018

Try:

Install all the required tools and configurations using Microsoft's windows-build-tools by running npm install -g windows-build-tools from an elevated PowerShell (run as Administrator).

https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration