Ubuntu18.4版本系统使用electron启动遇到找不到.so依赖

it2023-03-22  79

Ubuntu18.4版本系统使用electron遇到dist/electron: error while loading shared libraries: xx.so.xx: cannot open shared object file: No such file or directory

在启动electron应用时执行命令electron . 程序报错如下

第一步先查找该*.so文件属于哪个包

使用 apt-file search 查找

执行安装命令 sudo apt-get install apt-file安装完成后,命令行提示你update,如果没有,自行在命令行输入sudo apt-get update使用 sudo apt-get search xxx 查询so文件输入哪个包 上图中libasound.so.2对应的包为libasound2

安装缺少的依赖包文件

apt-get install libasound2 完成以来包安装

重新执行npm start命令启动

如果有还有其他依赖包没有安装,继续执行步骤1和2,直至所有依赖都ok

最新回复(0)