14

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
2
  • 1
    Have you looked at the error msg in the stack trace Error: Can't find Python executable "C:\Programs\Python2.7\python2.7.exe", you can set the PYTHON env variable. Commented Apr 29, 2019 at 17:24
  • 1
    how can i do it? Commented Apr 29, 2019 at 17:37

4 Answers 4

10

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

Sign up to request clarification or add additional context in comments.

Comments

6

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

2 Comments

what do i need to do after that?
re-run your file
1

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

1 Comment

this resolved it for me. I was having issue with v16.9.1, I downgraded to v14.17.3 and no more error.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.