You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had nodegit 0.0.74 installed and recently got the update to 77. On 'npm update' i got the error posted below. Obviously, the gyp expects 'python' to be version 2.x. I have python 2 and 3 installed. 'python' is a symlink to python 3.3, while python2 is available on my system for python 2.7.
So: Wouldn't it be possible to try multiple binaries / symlinks via gyp? Maybe: If 'python' is version 3.x, try 'python2'?
Here is the stderr output:
gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.3.0, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:118:14)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:107:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:600:7)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at maybeClose (child_process.js:700:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:767:5)
gyp ERR! System Linux 3.8.4-1-ARCH
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--python" "python"
gyp ERR! cwd /home/david/Dokumente/Development/reason/node_modules/nodegit
gyp ERR! node -v v0.10.1
gyp ERR! node-gyp -v v0.8.5
gyp ERR! not ok
npm ERR! nodegit@0.0.77 install: node install.js
npm ERR! sh "-c" "node install.js" failed with 1
npm ERR!
npm ERR! Failed at the nodegit@0.0.77 install script.
npm ERR! This is most likely a problem with the nodegit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls nodegit
npm ERR! There is likely additional logging output above.
Line 71 of install.js is where it is currently checking for Python availability:
varpythonExecutable='python';functioncheckPython2Exists(callback){exec('which python2',function(error){if(error!==null){pythonExecutable='python2';callback();return;}// python2 is not available, check for pythonexec('which python',function(error){if(error){thrownewError('Python is required to build libgit2');}callback();});});},
Then on line 121 down, the pythonExectuable variable is used in the node-gyp call like this:
Activity
faceleg commentedon Mar 25, 2013
Line 71 of install.js is where it is currently checking for Python availability:
Then on line 121 down, the
pythonExectuablevariable is used in the node-gyp call like this:I'm far from an expert in
node-gyp(or Python) - how do you suggest I improve this process to make it compatible with more systems?dctr commentedon Mar 26, 2013
Wait, 'if (error !== null)'? Shouldn't it be 'if (error === null)' or 'if (!error)'?
So, if it finds python2, error is null and pythonExecutable is not set, but python is used instead...
dctr commentedon Mar 26, 2013
Just forked you repo, changed code accordingly and opened a pull request.
Would be nice if you update the package in NPM after pulling my changes in.
faceleg commentedon Mar 26, 2013
Hi @dctr, I pulled & updated the
npmpackage, please close this issue if it is now fixed?Thank you very much for submitting your pull request, and sorry I wasn't able to take action on it immediately.
vvo commentedon Sep 4, 2013
For people wondering how to solve this for other npm installs: