Electron npm install 常见错误(Linux)

Linux版本

Ubuntu 12.04 (32bit)

安装Git

sudo apt-get install git

生成ssh key

1#查看有没有sshkey 2cd ~/.ssh 3#生成 4ssh-keygen 5#查询 6cat ~/.ssh/id_rsa.pub

安装node

使用二进制文件

错误一:./node: cannot execute binary file

原因可能如下:

1、非root用户或者无执行权限

2、编译环境不同(程序由其他操作环境复制过来)

PS:https://blog.51cto.com/1381479/888198

错误二:axconfig: port 1 not active axconfig: port 2 not active

原因:可能 sudo apt-get install node 这么去安装node了。

解决:先 sudo apt-get remove node 卸载掉,从node官网下。

PS:https://dolinux.blogspot.com/2012/04/axconfig-port-1-not-active-axconfig.html

编译源码

错误一:WARNING: failed to autodetect C++ compiler version (CXX=g++)

ERROR: Did not find a new enough assembler, install one or build with

       --openssl-no-asm.

       Please refer to BUILDING.md

PS:因为安装过程复制且不顺利,就不走这条路。

低版本的node

https://nodejs.org/download/release/latest-v8.x/

PS:Node 10.10以上版本,Ubuntu 12.04一直无法正常使用,所以我用了8版本。

安装步骤:https://www.cnblogs.com/zhuawang/p/7617176.html

建立软连接:

1sudo ln -s /home/lufeng/Documents/node-v8.16.0-linux-x86/bin/node /usr/local/bin 2sudo ln -s /home/lufeng/Documents/node-v8.16.0-linux-x86/bin/npm /usr/local/bin 3sudo ln -s /home/lufeng/Documents/node-v8.16.0-linux-x86/bin/node-gyp /usr/local/bin

electron npm install

错误一: ../../../nan/nan.h:50:3: error: #error This version of node/NAN/v8 requires a C++11 compiler

解决:http://mortenvp.com/installing-a-newer-gccg-on-ubuntu-12-04-lts/

1sudo add-apt-repository ppa:ubuntu-toolchain-r/test 2sudo apt-get update 3sudo apt-get install gcc-4.9 g++-4.9 4sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9

错误二:make: cc: Command not found

解决:

sudo ln -s  /usr/bin/gcc-4.9 /usr/bin/cc

错误三:/usr/bin/ld: cannot find -lcrypto

下载一个libcrypto.so.6 文件

sudo ln -s /home/lufeng/Documents/lib/libcrypto.so.6 /lib/libcrypto.so

or

yum install openssl-devel

错误四:error: 'memcpy' was not declared in this scope

原因:node插件源码报错了,其实解决办法很容易,到程序中加上头文件string.h就好了,就是 #include<string.h>

electron rebuild

错误一:fatal error openssl/rand.h no such file or directory

解决:安装libssl-dev。

sudo apt-get install libssl-dev

可能libssl-dev会安装失败

sudo apt-get install libssl-dev=1.0.1-4ubuntu5

解决:https://www.cnblogs.com/liushui-sky/p/9304495.html (方法一)

or

yum install -y openssl openssl-devel openssl-libs

错误二:error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

解决:

sudo apt-get install libxss1

错误三:error while loading shared libraries: libatk-bridge-2.0.so.0: cannot open shared object file: No such file or directory

暂时无解:一直install 不了libatk-bridge2.0-0这个依赖,总是报未找到匹配软件包!!!

总结

Electron rebuild到上面最后的一个错,就走不下去了,那个缺失的库始终无法安装,也就是Ubuntu 12.04 上运行Electron宣告失败。

Ubuntu12.04 试了两天,太心累了,系统缺失的库太多了且有装不上的。

最后,我更换Ubuntu16.04 做尝试,却很快成功跑起Electron。它仅仅缺失一个库,上面大部分错误都没有出现。不过要注意Node使用10版本、gcc使用4.9就行了,使用Node 12、gcc 5都会报错的。 

其他Linux

错误一:Need executable 'rpmbuild' to convert dir to rpm。

解决:

yum install rpm-build

错误二:打开应用时,显示 segmentation fault。

原因:打包appId重复了。

错误三:没有go

解决:

sudo yum install golang
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )

Electron npm install 常见错误(Linux) - HelloWorld