首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ld:找不到-lX11或-lpng

ld:找不到-lX11或-lpng
EN

Stack Overflow用户
提问于 2018-07-16 00:23:26
回答 1查看 2K关注 0票数 0

在我的mac上运行npm install face-recognition很好,但是当我尝试在Debian上运行它时,它会失败,出现以下错误:

代码语言:javascript
复制
  SOLINK_MODULE(target) Release/obj.target/facerec.node
/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/obj.target/facerec.node' failed
make: *** [Release/obj.target/facerec.node] 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 face-rec@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! face-recognition@0.9.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the face-recognition@0.9.3 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

我认为关键的部分是第2行和第3行,关于ld找不到-lX11-lpng的部分。这在mac上很容易通过安装X石英来解决,但是在Linux服务器上解决这个问题似乎是不可能的。有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-07-16 04:21:24

你只是错过了图书馆。试试这个:

代码语言:javascript
复制
apt-get install libpng-dev libx11
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51353240

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档