Skip to content
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

Can't install with npm install sharp #46

Closed
eonezhang opened this issue Jun 1, 2014 · 9 comments
Closed

Can't install with npm install sharp #46

eonezhang opened this issue Jun 1, 2014 · 9 comments
Labels

Comments

@eonezhang
Copy link

sharp@0.4.2 install /private/tmp/node_modules/sharp
node-gyp rebuild

/bin/sh: pkg-config: command not found
gyp: Call to 'PKG_CONFIG_PATH="/usr/local/Library/ENV/pkgconfig/10.8:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" pkg-config --libs vips' returned exit status 127.
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/src/node-v0.10.26-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 13.2.0
gyp ERR! command "node" "/usr/local/src/node-v0.10.26-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /private/tmp/node_modules/sharp
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! sharp@0.4.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.4.2 install script.
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 ERR! System Darwin 13.2.0
npm ERR! command "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "install" "sharp"
npm ERR! cwd /private/tmp
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/tmp/npm-debug.log
npm ERR! not ok code 0

@eonezhang
Copy link
Author

log:

131 info install sharp@0.4.2
132 verbose unsafe-perm in lifecycle true
133 info sharp@0.4.2 Failed to exec install script
134 info /private/tmp/node_modules/sharp unbuild
135 info preuninstall sharp@0.4.2
136 info uninstall sharp@0.4.2
137 verbose true,/private/tmp/node_modules,/private/tmp/node_modules unbuild sharp@0.4.2
138 info postuninstall sharp@0.4.2
139 error sharp@0.4.2 install: node-gyp rebuild
139 error Exit status 1
140 error Failed at the sharp@0.4.2 install script.
140 error This is most likely a problem with the sharp package,
140 error not with npm itself.
140 error Tell the author that this fails on your system:
140 error node-gyp rebuild
140 error You can get their info via:
140 error npm owner ls sharp
140 error There is likely additional logging output above.
141 error System Darwin 13.2.0
142 error command "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "install" "sharp"
143 error cwd /private/tmp
144 error node -v v0.10.26
145 error npm -v 1.4.3
146 error code ELIFECYCLE
147 verbose exit [ 1, true ]

@lovell
Copy link
Owner

lovell commented Jun 1, 2014

The presence of "Darwin 13.2.0" tells me you're using a Mac. Did you install libvips via homebrew? If so, pkg-config is included as a build-time dependency.

It looks like the pkg-config executable is either missing or at a location the command line cannot access. What do the following two commands return on your machine?

whereis pkg-config
which pkg-config

@lovell lovell added the triage label Jun 1, 2014
@pierreinglebert
Copy link
Contributor

Maybe we should add a link to the brew installation instructions in the MacOS installation paragraph.

@lovell
Copy link
Owner

lovell commented Jun 4, 2014

@pierreinglebert I'm planning to add a "bootstrap/configure" check to npm install that verifies the system and dependencies are OK, providing platform-specific installation instructions for anything missing.

(See #42 (comment) for the genesis of this idea.)

@lovell
Copy link
Owner

lovell commented Jun 18, 2014

Hi @eonezhang, there are a few improvements to determining the pkg-config path in v0.5.1. Are you able to retry using the latest version from npm?

@lovell
Copy link
Owner

lovell commented Jul 27, 2014

Hi @eonezhang, have you been able to make any progress with this problem?

@lovell
Copy link
Owner

lovell commented Jul 30, 2014

Closing due to inactivity. Please feel free to re-open if the problem persists. Thanks!

@lovell lovell closed this as completed Jul 30, 2014
@ghost
Copy link

ghost commented Feb 27, 2018

Hi @lovell
Trying to install sharp dependency in package.json
'npm install node-gyp --s'
'npm install sharp --s'
I get no errors. Node-gyp appears in the dependency but sharp is nowhere to be found.
What am I missing?

@lovell
Copy link
Owner

lovell commented Feb 27, 2018

@Cedric12114 Is your use of the --s flag intentional? It means npm will be "silent" and suppress errors. Perhaps try without and see what is says. Feel free to open a new issue if there's an error that no one else has previously reported.

Repository owner locked and limited conversation to collaborators Feb 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants