lovell/sharp

ld: library not found for -ljpeg

volatilegg opened this issue · 6 comments

Hi I got this error" ld: library not found for -ljpeg " . Could you please help me solve the problem?

node-gyp rebuild

CXX(target) Release/obj.target/sharp/src/sharp.o
SOLINK_MODULE(target) Release/sharp.node
ld: library not found for -ljpeg
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/sharp.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 13.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/doduc/Desktop/aidbrella-git/backend/node_modules/sharp
gyp ERR! node -v v0.10.30
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! sharp@0.5.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.5.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.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "sharp"
npm ERR! cwd /Users/doduc/Desktop/aidbrella-git/backend
npm ERR! node -v v0.10.30
npm ERR! npm -v 2.0.0-alpha-5
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/doduc/Desktop/aidbrella-git/backend/npm-debug.log
npm ERR! not ok code 0

Hi @volatilegg, please can you try brew unlink jpeg then brew link jpeg before trying again.

I tried but It stills showed the same error :(

I tried run this command:
"xcode-select --install"
and the problem is gone.
Thanks you :)

Thanks for the update @volatilegg, glad to hear you got it working.

I've added your advice to the Mac installation instructions in the README as others have reported a similar problem previously.

What is the solution to this issue in 2020? Thanks.

@tommycarstensen Please open a new installation issue at https://github.com/lovell/sharp/issues/new?labels=installation&template=installation.md ensuring all questions are answered.