Unable to find Python executable "/path/to/executable/python2.7", you can set env variable PYTHON

bufferutil@1.2.1 install / home / sudthenerd / polymer-starter-kit-1.2.1 / node_modules / bufferutil> node -gyp rebuild gyp ERR! configure error gyp ERR! stack Error: Cannot find the Python executable "/path/to/executable/python2.7", you can set the env variable PYTHON . gyp ERR! stack at failNoPython (/ usr / lib / node_modules / npm / node_modules / node-gyp / lib / configure.js: 401: 14) gyp ERR! stack in / usr / lib / node_modules / npm / node_modules / node-gyp / lib / configure.js: 330: 11 gyp ERR! stack in F (/usr/lib/node_modules/npm/node_modules/which/which.js:78:16) gyp ERR! stack in E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:29) gyp ERR! stack in / usr / lib / node_modules / npm / node_modules / which / which.js: 93: 16 gyp ERR! stack in FSReqWrap.oncomplete (fs.js: 82: 15) gyp ERR! System Linux 3.13.0-74-generic gyp ERR! command "/ usr / bin / nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd / home / sudthenerd / polymer-starter-kit-1.2.1 / node_modules / bufferutil gyp ERR! node -v v5.3.0 gyp ERR! node -gyp -v v3.2.1 gyp ERR! not normal npm WARN install: bufferutil@1.2.1 bufferutil@1.2.1 install: node-gyp rebuild npm WARN install: bufferutil@1.2.1 Exit status 1> utf-8-validate@1.2.1 install / home / sudthenerd / polymer -starter-kit-1.2. 1 / node_modules / utf-8-validate> node -gyp rebuild gyp ERR! configure error gyp ERR! stack Error: cannot find Python executable "/path/to/executable/python2.7", you can set env variable PYTHON. gyp ERR! stack at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) gyp ERR! stack in / usr / lib / node_modules / npm / node_modules / node-gyp / lib / configure.js: 330: 11 gyp ERR! stack in F (/usr/lib/node_modules/npm/node_modules/which/which.js:78:16) gyp ERR! stack in E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:29) gyp ERR! stack in / usr / lib / node_modules / npm / node_modules / which / which.js: 93: 16 gyp ERR! stack in FSReqWrap.oncomplete (fs.js: 82: 15) gyp ERR! System Linux 3.13.0-74-generic gyp ERR! command "/ usr / bin / nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd / home / sudthenerd / polymer-starter-kit-1.2.1 / node_modules / utf-8-validate gyp ERR! node -v v5.3.0 gyp ERR! node -gyp -v v3.2.1 gyp ERR! not normal npm WARN install: utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: node-gyp rebuild npm WARN install: utf-8-validate@1.2.1 Exit status 1

+5
source share
2 answers

Scott Frees solution doesn't work for me, but works

npm config set python $(which python)

did.

+14
source

If you installed Python using the package manager, it should already be in your path, but if not: add it like this:

export PATH = "$ PATH: / usr / local / bin / python (or wherever you install python)

Node -gyp requires 2.x and cannot use Python3 (do you have the correct version installed?).

See Running Python on Windows for Node.js dependencies for Windows to make sure you have the environment variable set.

+2
source

Source: https://habr.com/ru/post/1239694/


All Articles