supfiger
supfiger

Reputation: 141

gyp ERR! stack Error: Can't find Python executable

I've removed node-modules, reinstall it, tried to install npm install --global node-gyp, cleaned force cache and other

error C:\Users\me\work\proj\node_modules\sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\Users\me\work\proj\node_modules\sha3
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Programs\Python2.7\python2.7.exe", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\me\work\proj\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\me\work\proj\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at C:\Users\me\work\proj\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\me\\work\\proj\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\me\work\proj\node_modules\sha3

Upvotes: 14

Views: 34863

Answers (4)

alan9uo
alan9uo

Reputation: 1131

I you use the high version of Node. Try to downgrade .

Upvotes: 1

nilakantha singh deo
nilakantha singh deo

Reputation: 1006

gyp ERR! stack Error: Command failed:

This is due to the fact that python2 is not installed.

node gyp does not require python 3 rather python2.

Alternatively installation of node version 12 inplace of version 10 solves the issues as it installs the missing visualstudio2017-workload-vctools...

Upvotes: 0

Reed Dunkle
Reed Dunkle

Reputation: 3597

The node-gyp installation instructions provide two options to get all of their necessary dependencies, including Python 2.

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).

npm install --global --production windows-build-tools

Option 2 is to install them manually, individually. Read everything here: https://github.com/nodejs/node-gyp#on-windows

Upvotes: 10

Parkofadown
Parkofadown

Reputation: 646

It looks like you need to download python 2.7 to continue at python.org

Upvotes: 6

Related Questions