atom/git-utils

Incorrect Python version used on Arch Linux

saghm opened this issue · 5 comments

saghm commented

Build is failing on Arch Linux because the default Python version is 3.4 rather than 2.x:

gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.4.3, 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/share/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/lib/configure.js:108:14)
gyp ERR! stack     at /usr/share/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/lib/configure.js:97:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:656:7)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at maybeClose (child_process.js:766:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:833:5)
gyp ERR! System Linux 4.0.7-2-ARCH
gyp ERR! command "node" "/usr/share/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-115620-4222-5xafm9/node_modules/git-projects/node_modules/git-utils
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 4.0.7-2-ARCH
npm ERR! argv "/usr/share/atom/resources/app/apm/bin/node" "/usr/share/atom/resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/home/saghm/.atom/.apm/.apmrc" "--userconfig" "/home/saghm/.atom/.apmrc" "install" "/tmp/d-115620-4222-1akeoaa/package.tgz" "--target=0.22.0" "--arch=x64"
npm ERR! node v0.10.35
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

Same issue on Gentoo, python at 3.5.0, I have a version < 3 installed but how do I specify it? Can't find docs with --python switch syntax.

saghm commented

--python is a switch for node-gyp, so I don't think there's any way to pass it directly when running atom update. However, I was able to update since then, although I'm honestly not sure what changed.

npm install git-utils -g --python=python2

saghm commented

At least on Arch Linux, npm isn't a dependency for atom (at least, not in the binary package). Not that it's that much of a hassle to install it, but for people who don't otherwise want/need it installed, that might not be a preferred fix.

No problem, I was just sharing a syntax use of --python which worked for me.