在contos上运行electron
首先配置好ssh + x11 可以界面显示 配置ssh+x11
然后运行 electron-quick-start
问题: 运行electorn . 报错:error while loading shared libraries: libX11-xcb.so.1
yum install libX11-devel --nogpg
问题: error while loading shared libraries: libatk-bridge-2.0.so.0
yum install at-spi2-atk -y
问题:error while loading shared libraries: libgtk-3.so.0
yum install gtk3 -y
问题:error while loading shared libraries: libXss.so.1
yum install libXScrnSaver* -y
问题:error while loading shared libraries: libdrm.so.2
yum install libdrm*
问题:error while loading shared libraries: libgbm.so.1
yum install libgbm*
分享几个有用的工具
1. 查找缺失的库文件对应的安装库例如
repoquery --whatprovides libgbm.so.1
这里对于 libgbm.so.1,查找的结果为空,所以安装方法为yum install libgbm*
2. ldd /var/electron 查找依赖的包
[root@sg-test-kp-40-90 test1]# ldd /var/zpert/electron/test1/node_modules/electron/dist/electron
linux-vdso.so.1 (0x0000ffff89176000)
libffmpeg.so => /var/zpert/electron/test1/node_modules/electron/dist/libffmpeg.so (0x0000ffff816e1000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000ffff816c0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000ffff8168b000)
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x0000ffff81619000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000ffff814d7000)
libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x0000ffff81304000)
libX11.so.6 => /lib64/libX11.so.6 (0x0000ffff811b0000)
libX11-xcb.so.1 => /lib64/libX11-xcb.so.1 (0x0000ffff8118f000)
libxcb.so.1 => /lib64/libxcb.so.1 (0x0000ffff8114e000)
libxcb-dri3.so.0 => /lib64/libxcb-dri3.so.0 (0x0000ffff8112d000)
libXcomposite.so.1 => /lib64/libXcomposite.so.1 (0x0000ffff8110c000)
libXcursor.so.1 => /lib64/libXcursor.so.1 (0x0000ffff810eb000)
libXdamage.so.1 => /lib64/libXdamage.so.1 (0x0000ffff810ca000)
libXext.so.6 => /lib64/libXext.so.6 (0x0000ffff81099000)
libXfixes.so.3 => /lib64/libXfixes.so.3 (0x0000ffff81078000)
libXi.so.6 => /lib64/libXi.so.6 (0x0000ffff81057000)
libXrender.so.1 => /lib64/libXrender.so.1 (0x0000ffff81036000)
libXtst.so.6 => /lib64/libXtst.so.6 (0x0000ffff81015000)
libnss3.so => /lib64/libnss3.so (0x0000ffff80ee2000)
libnssutil3.so => /lib64/libnssutil3.so (0x0000ffff80e91000)
libsmime3.so => /lib64/libsmime3.so (0x0000ffff80e50000)
libnspr4.so => /lib64/libnspr4.so (0x0000ffff80dfc000)
libatk-1.0.so.0 => /lib64/libatk-1.0.so.0 (0x0000ffff80dbb000)
libatk-bridge-2.0.so.0 => /lib64/libatk-bridge-2.0.so.0 (0x0000ffff80d69000)
libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x0000ffff80cf8000)
libgdk_pixbuf-2.0.so.0 => /lib64/libgdk_pixbuf-2.0.so.0 (0x0000ffff80cb7000)
libgtk-3.so.0 => /lib64/libgtk-3.so.0 (0x0000ffff8051f000)
libgdk-3.so.0 => /lib64/libgdk-3.so.0 (0x0000ffff8041d000)
libpangocairo-1.0.so.0 => /lib64/libpangocairo-1.0.so.0 (0x0000ffff803fc000)
libpango-1.0.so.0 => /lib64/libpango-1.0.so.0 (0x0000ffff8039b000)
libcairo.so.2 => /lib64/libcairo.so.2 (0x0000ffff80269000)
libm.so.6 => /lib64/libm.so.6 (0x0000ffff80198000)
libXrandr.so.2 => /lib64/libXrandr.so.2 (0x0000ffff80177000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x0000ffff80136000)
libdrm.so.2 => /lib64/libdrm.so.2 (0x0000ffff80105000)
libgbm.so.1 => not found
libasound.so.2 => /lib64/libasound.so.2 (0x0000ffff7ffe4000)
libatspi.so.0 => /lib64/libatspi.so.0 (0x0000ffff7ff93000)
libcups.so.2 => /lib64/libcups.so.2 (0x0000ffff7fee2000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000ffff7feb1000)
libc.so.6 => /lib64/libc.so.6 (0x0000ffff7fd2b000)
注释libgbm.so.1 => not found为缺失的包
运行成功了报错:FATAL:electron_main_delegate.cc(264)] Running as root without --no-sandbox is not supported.
运行命令加入
electron -no-sandbox .
运行成功
中文字符乱码问题:
yum -y install wqy-zenhei-fonts* #安装中文字库