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

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

System: Win10

Gatsby using a Starter [1] be npm installa problem when:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (G:\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:101:14)
gyp ERR! stack     at G:\nodejs\node_modules\npm\node_modules\node-gyp\lib\confi
gure.js:64:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "G:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\
bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\system32\node_modules\caress-server\node_modules\buffert
ools
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.

Root Cause

Some npm plugins need node-gyp to be installed.

However, node-gyp has it's own dependencies

Anyway, a series of components are not installed.

Note : This gadget does not support Python 3.0, so only 2.7 can be installed

Solution Step 1

The first answer found by Stackoverflow [2] :

The administrator executes:

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

Then execute:

$ npm install --global node-gyp

Solution Step 2

However, the solution on the goose seems to be useless for my computer ...

May need to be set manually [3]

npm config set python python2.7
npm config set msvs_version 2015

I ’m not sure if this setting will affect the runtime, so I set an environment variable

PYTHON = C:\Users\Zill.windows-build-tools\python27\python.exe

Note that the file name needs to be detailed here

Then solved

 

Published 51 original articles · 19 praises · 60,000+ views

Guess you like

Origin blog.csdn.net/qq_40999917/article/details/104786488