方法一、简单粗暴
1.到https://github.com/geeeeeeeeek/electronic-wechat/找到最新的安装包
linux-x64.tar.gz
2.解压
tar -zxvf linux-x64.tar.gz
3.直接运行
[root@localhost electronic-wechat-linux-x64]# ./electronic-wechat
./electronic-wechat: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
这里有可能会报错,如果报错就去下载libXScrnSaver-1.2.2-6.1.el7.x86_64
[root@localhost electronic-wechat-linux-x64]# yum provides */libXss.so.1
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
local/filelists_db | 3.1 MB 00:00:00
libXScrnSaver-1.2.2-6.1.el7.x86_64 : X.Org X11 libXss runtime library
源 :local
匹配来源:
文件名 :/usr/lib64/libXss.so.1
[root@localhost electronic-wechat-linux-x64]# yum -y install libXScrnSaver-1.2.2-6.1.el7.x86_64
安装完毕之后再次运行
[root@localhost electronic-wechat-linux-x64]# ./electronic-wechat
方法二、npm安装
下载仓库
git clone https://github.com/geeeeeeeeek/electronic-wechat.git
或者git clone https://github.com/kooritea/electronic-wechat.git
安装依赖运行
npm install
报错
gyp WARN EACCES user "root" does not have permission to access the dev dir "/opt/electronic-wechat/node_modules/nodejieba/.node-gyp/10.2.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/electronic-wechat/node_modules/nodejieba/.node-gyp"
解决办法
[root@localhost electronic-wechat]# rm -rf node_modules/electron
[root@localhost electronic-wechat]# npm install -g --unsafe-perm
[root@localhost electronic-wechat]# npm start
到这里就应该启动成功了
也可以根据你的平台打包应用,注意不要把build敲错,楼主就是敲错好多次然后一直百度原因......
npm run build:osx
npm run build:linux
npm run build:win
制作桌面快捷方式
1.生成桌面快捷方式文件
gedit /usr/share/applications/wechat.desktop
文件内容:
[Desktop Entry]
Type=Application
Name=electron-wechat
GenericName=electron-wechat
Comment=wechat for linux
Exec=/home/electronic-wechat-linux-x64/electronic-wechat
Icon=/home/electronic-wechat-linux-x64/electronic-wechat.png
Terminal=wechat
Categories=wechat;
注意:如果是用npm安装的,electronic-wechat的执行脚本在“electron-wechat/dist/electronic-wechat-linux-x64”,图标在electronic-wechat/assets/icon.png
2.下载一个微信图标
wget https://raw.githubusercontent.com/geeeeeeeeek/electronic-wechat/master/assets/icon.png -O electronic-wechat.png
3.快捷方式拷贝到桌面
cp /usr/share/applications/wechat.desktop /root/桌面
======后续=======
发现另外一个linux上的微信软件https://github.com/trazyn/weweChat/releases
直接下载appimage版,chmod +x xxx.appimage,即可以脚本的形式运行