New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-gyp rebuild error (?) #163

Closed
ghost opened this Issue Feb 11, 2015 · 13 comments

Comments

5 participants
@ghost
Copy link

ghost commented Feb 11, 2015

I have this issue when I try to install sharp package:

> sharp@0.9.1 install /usr/local/lib/node_modules/sharp
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: spawn /path/to/executable/python2.7 ENOENT
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
gyp ERR! stack     at child_process.js:1137:20
gyp ERR! stack     at process._tickCallback (node.js:355:11)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/sharp
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "sharp"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.0
npm ERR! code ELIFECYCLE

npm ERR! sharp@0.9.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.9.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the sharp 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 sharp
npm ERR! There is likely additional logging output above.
@lovell

This comment has been minimized.

Copy link
Owner

lovell commented Feb 11, 2015

Hello, could this be on a machine that has been recently upgraded to Node 0.12?

https://github.com/lovell/sharp/blob/master/CONTRIBUTING.md#submit-a-new-bug-report

What is the output of npm install --verbose sharp?

@lovell lovell added the triage label Feb 11, 2015

@ghost

This comment has been minimized.

Copy link

ghost commented Feb 11, 2015

In verbose, when the error happen :

> sharp@0.9.1 install /Users/lucinda/node_modules/sharp
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp verb cli [ 'node',
gyp verb cli   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild' ]
gyp info using node-gyp@1.0.2
gyp info using node@0.12.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "/path/to/executable/python2.7" in the PATH
gyp verb `which` succeeded /path/to/executable/python2.7 /path/to/executable/python2.7
gyp ERR! configure error 
gyp ERR! stack Error: spawn /path/to/executable/python2.7 ENOENT
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
gyp ERR! stack     at child_process.js:1137:20
gyp ERR! stack     at process._tickCallback (node.js:355:11)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/lucinda/node_modules/sharp
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm verb unsafe-perm in lifecycle true
npm info sharp@0.9.1 Failed to exec install script
npm verb unlock done using /Users/lucinda/.npm/_locks/sharp-b55f18f3794170d4.lock for /Users/lucinda/node_modules/sharp
npm verb stack Error: sharp@0.9.1 install: `node-gyp rebuild`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
npm verb stack     at EventEmitter.emit (events.js:110:17)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:14:12)
npm verb stack     at ChildProcess.emit (events.js:110:17)
npm verb stack     at maybeClose (child_process.js:1008:16)
npm verb stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
npm verb pkgid sharp@0.9.1
npm verb cwd /Users/lucinda/Desktop/Lab/bot/test
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "--verbose" "sharp"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.0
npm ERR! code ELIFECYCLE

npm ERR! sharp@0.9.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.9.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the sharp 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 sharp
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]
npm verb unbuild node_modules/sharp
npm info preuninstall sharp@0.9.1
npm info uninstall sharp@0.9.1
npm verb unbuild rmStuff sharp@0.9.1 from /Users/lucinda/node_modules
npm info postuninstall sharp@0.9.1
npm verb gentlyRm vacuuming /Users/lucinda/node_modules/sharp

I recently upgraded to 0.12.

@lovell

This comment has been minimized.

Copy link
Owner

lovell commented Feb 11, 2015

gyp ERR! stack Error: spawn /path/to/executable/python2.7 ENOENT

It looks like Python is missing or, if installed, npm/node-gyp can't find it.

You may need to tell npm where Python is via:

npm config set python /usr/bin/python

where /usr/bin/python is the location of the Python executable - you'll need to change this to match the location on your machine.

@ghost

This comment has been minimized.

Copy link

ghost commented Feb 13, 2015

It's done, but seems to have another problem :


gyp info it worked if it ends with ok
gyp verb cli [ 'node',
gyp verb cli   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild' ]
gyp info using node-gyp@1.0.2
gyp info using node@0.12.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "/Library/Frameworks/Python.framework/Versions/2.7/bin" in the PATH
gyp verb `which` succeeded /Library/Frameworks/Python.framework/Versions/2.7/bin /Library/Frameworks/Python.framework/Versions/2.7/bin
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack Error: spawn EACCES
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at ChildProcess.spawn (child_process.js:1155:11)
gyp ERR! stack     at exports.spawn (child_process.js:988:9)
gyp ERR! stack     at exports.execFile (child_process.js:682:15)
gyp ERR! stack     at checkPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:79:5)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:46:9
gyp ERR! stack     at which (/usr/local/lib/node_modules/npm/node_modules/which/which.js:28:31)
gyp ERR! stack     at checkPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:36:5)
gyp ERR! stack     at configure (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:31:3)
gyp ERR! stack     at Object.self.commands.(anonymous function) [as configure] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/lucinda/node_modules/sharp
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/TooTallNate/node-gyp/issues>
npm verb unsafe-perm in lifecycle true
npm info sharp@0.9.1 Failed to exec install script
npm verb unlock done using /Users/lucinda/.npm/_locks/sharp-b55f18f3794170d4.lock for /Users/lucinda/node_modules/sharp
npm verb stack Error: sharp@0.9.1 install: `node-gyp rebuild`
npm verb stack Exit status 7
npm verb stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
npm verb stack     at EventEmitter.emit (events.js:110:17)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:14:12)
npm verb stack     at ChildProcess.emit (events.js:110:17)
npm verb stack     at maybeClose (child_process.js:1008:16)
npm verb stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
npm verb pkgid sharp@0.9.1
npm verb cwd /Users/lucinda/Desktop/Lab/bot/test
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "sharp" "--verbose"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.0
npm ERR! code ELIFECYCLE

npm ERR! sharp@0.9.1 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the sharp@0.9.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the sharp 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 sharp
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]
npm verb unbuild node_modules/sharp
npm info preuninstall sharp@0.9.1
npm info uninstall sharp@0.9.1
npm verb unbuild rmStuff sharp@0.9.1 from /Users/lucinda/node_modules
npm info postuninstall sharp@0.9.1
npm verb gentlyRm vacuuming /Users/lucinda/node_modules/sharp

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/lucinda/Desktop/Lab/bot/test/npm-debug.log


@lovell

This comment has been minimized.

Copy link
Owner

lovell commented Feb 13, 2015

My best guess is this is a permissions thing. node-gyp has found Python but can't run it. You might need to set the PYTHONPATH environment variable.

I don't believe this problem is specific to the sharp module. You'll probably run into the same error with any npm-installed module that requires C++ compilation, e.g. npm install bcrypt.

@lovell

This comment has been minimized.

Copy link
Owner

lovell commented Feb 24, 2015

@Triplecheeze were you able to make any progress solving this problem?

@ghost

This comment has been minimized.

Copy link

ghost commented Feb 24, 2015

Yes, problem solved, thank you.
This was a Path problem !

@lovell

This comment has been minimized.

Copy link
Owner

lovell commented Feb 25, 2015

Great to hear it, thanks for confirming.

@lovell lovell closed this Feb 25, 2015

@ghost

This comment has been minimized.

Copy link

ghost commented Apr 22, 2015

2015-04-23 1 09 28
Is this a path problem,how can i fix it !

@xtu

This comment has been minimized.

Copy link

xtu commented Jul 21, 2015

I came across the same problem today. It was fixed by specifying the python executable's path explicitly by

npm config set python C:\Python27\python.exe

Note that use must specify the python executable's full name including extension.

@trusktr

This comment has been minimized.

Copy link

trusktr commented Jul 28, 2015

I had this problem while using npm.command.install() programmatically. When I switched to CLI it went away: child_process.exec('npm install').

@ehimah

This comment has been minimized.

Copy link

ehimah commented Aug 15, 2015

Thanks @xtu

npm config set python C:\Python27\python.exe

worked for me

@pradhanshrijal

This comment has been minimized.

Copy link

pradhanshrijal commented Aug 18, 2015

I had the same problem trying to install i2c. I am using Debian Wheezy on my Beaglebone Black.
gyperror
I tried this command without success:

npm config set python /usr/bin/python2.6

Repository owner locked and limited conversation to collaborators Aug 18, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.