ld: cannot find -lX11 or -lpng

Running npm install face-recognition runs fine on my mac, but when I try to do it on my Debian VM, it fails with the following error:

 SOLINK_MODULE(target) Release/ /usr/bin/ld: cannot find -lX11 /usr/bin/ld: cannot find -lpng collect2: error: ld returned 1 exit status facerec.target.mk:157: recipe for target 'Release/ failed make: *** [Release/ Error 1 make: Leaving directory '/home/ben/face-rec/node_modules/face-recognition/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Linux 4.9.0-6-amd64 gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/ben/face-rec/node_modules/face-recognition gyp ERR! node -v v8.11.3 gyp ERR! node-gyp -v v3.7.0 gyp ERR! not ok npm WARN [email protected] No repository field. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/ben/.npm/_logs/2018-07-15T19_28_00_238Z-debug.log 

I think the key parts are lines 2 and 3, the parts about ld not being able to find -lX11 or -lpng. This is easily solved on a mac by installing Xquartz, but a workaround seems impossible on a Linux server. Any ideas?

6

1 Answer

You're simply missing the libraries. Try this:

apt-get install libpng-dev libx11 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like