Centos7 如何正确的安装依赖包?

2018-08-28 10:41:09 +08:00
 s609926202

比如我运行程序时发生了这么一段错误:

┏ Electron -------------------

  /home/wwwroot/topsi-project-manager/node_modules/electron/dist/electron: error while loading shared libraries: libXtst.so.6: cannot open shared object file: No such file or directory
  
┗ ----------------------------

显然是缺少这个 libXtst.so.6 依赖库的,那么我的安装方法如下:

# yum whatprovides libXtst.so.6

找到提供这个依赖库的安装包,然后安装:

已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vpshosting.com.hk
 * extras: mirror.vpshosting.com.hk
 * updates: mirror.vpshosting.com.hk
libXtst-1.2.3-1.el7.i686 : X.Org X11 libXtst runtime library
源    :base
匹配来源:
提供    :libXtst.so.6



libXtst-1.2.3-1.el7.i686 : X.Org X11 libXtst runtime library
源    :@base
匹配来源:
提供    :libXtst.so.6

安装 libXtst-1.2.3-1.el7.i68 这个库,也就说明安装了 libXtst.so.6。

*** 但是,没有用。那么,大家平时都是怎么安装的呢?***

3727 次点击
所在节点    问与答
2 条回复
wqsfree
2018-08-28 16:07:44 +08:00
yum list available | grep libXtst
julyclyde
2018-08-28 22:09:34 +08:00
你这个做法看起来没啥问题
我觉得你是不是可以先 ldd 一下 /home/wwwroot/topsi-project-manager/node_modules/electron/dist/electron

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/483864

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX