Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 489264 - net-libs/nodejs-0.10.21 - gyp ERR! stack Error: Python executable "python" is v3.2.5, which is not supported by gyp.
Summary: net-libs/nodejs-0.10.21 - gyp ERR! stack Error: Python executable "python" is...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Johan Bergström
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-10-24 14:40 UTC by Richard Nespithal (rndevfx)
Modified: 2014-07-22 00:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Nespithal (rndevfx) 2013-10-24 14:40:09 UTC
try to install pm2 via npm

$ npm install pm2
[...]
yp ERR! configure error 
gyp ERR! stack Error: Python executable "python" is v3.2.5, 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/lib64/node_modules/npm/node_modules/node-gyp/lib/configure.js:123:14)
gyp ERR! stack     at /usr/lib64/node_modules/npm/node_modules/node-gyp/lib/configure.js:112:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:635:7)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at maybeClose (child_process.js:735:16)
gyp ERR! stack     at Socket.<anonymous> (child_process.js:948:11)
gyp ERR! stack     at Socket.EventEmitter.emit (events.js:95:17)
gyp ERR! stack     at Pipe.close (net.js:466:12)
gyp ERR! System Linux 3.10.7-gentoo-r1
gyp ERR! command "node" "/usr/lib64/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/rnespithal/Development/1up-frontend/node_modules/pm2/node_modules/usage
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm http 304 https://registry.npmjs.org/keypress
npm ERR! not ok code 0

Reproducible: Always




Be sure all files are using python2

--- nodejs-0.10.21.ebuild	2013-10-24 16:35:55.750049207 +0200
+++ nodejs-0.10.21.ebuild.fix	2013-10-24 16:36:54.740050155 +0200
@@ -31,7 +31,11 @@
 	sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
 
 	# make sure we use python2.* while using gyp
-	sed -i -e  "s/python/python2/" deps/npm/node_modules/node-gyp/gyp/gyp || die
+	find -type f -exec sed \
+		-e 's_^#!/usr/bin/env python$_&2_' \
+		-e 's_^\(#!/usr/bin/python2\).[45]$_\1_' \
+		-e 's_^#!/usr/bin/python$_&2_' \
+		-e "s_'python'_'python2'_" -i {} \; || die
 
 	# less verbose install output (stating the same as portage, basically)
 	sed -i -e "/print/d" tools/install.py || die
Comment 1 Johan Bergström 2013-10-28 02:35:56 UTC
Why not do the check via RDEPEND?
Comment 2 Johan Bergström 2014-07-17 06:16:24 UTC
I'm actually not able to reproduce this using node v0.10.29:

$ eselect python list
Available Python interpreters:
  [1]   python2.7
  [2]   python3.2
  [3]   python3.3
  [4]   python3.4 *

$ npm install pm2
npm WARN optional dep failed, continuing fsevents@0.2.0
pm2@0.9.2 node_modules/pm2
├── json-stringify-safe@5.0.0
├── commander@2.2.0
├── eventemitter2@0.4.14
├── pm2-interface@0.1.3
├── colors@0.6.2
├── axm@0.1.4
├── pidusage@0.0.6
├── cron@1.0.4
├── cli-table@0.3.0
├── async@0.9.0
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
├── chokidar@0.8.2 (recursive-readdir@0.0.2)
├── axon@1.0.0 (escape-regexp@0.0.1, configurable@0.0.1)
├── pm2-axon-rpc@0.0.2 (commander@1.0.5)
├── debug@1.0.4 (ms@0.6.2)
├── pm2-multimeter@0.1.2 (charm@0.1.2)
├── pm2-deploy@0.0.4 (tv4@1.0.18)
├── nssocket@0.5.1 (lazy@1.0.11)
└── coffee-script@1.7.1 (mkdirp@0.3.5)

Patrick? Richard?
Comment 3 Johan Bergström 2014-07-22 00:42:50 UTC
As I cannot reproduce on any of my rigs, I'm closing with NEEDINFO for now. Feel free to reopen if you can provide steps to reproduce.