Electron npm install 常见错误(Linux)
Linux版本
Ubuntu 12.04 (32bit)
安装Git
sudo apt-get install git
生成ssh key
#查看有没有sshkey
cd ~/.ssh
#生成
ssh-keygen
#查询
cat ~/.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
建立软连接:
sudo ln -s /home/lufeng/Documents/node-v8.16.0-linux-x86/bin/node /usr/local/bin
sudo ln -s /home/lufeng/Documents/node-v8.16.0-linux-x86/bin/npm /usr/local/bin
sudo 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/
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 --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. /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
Electron npm install 常见错误(Linux)的更多相关文章
- Electron npm install 常见错误(Windows)
问题一:node_gyp使用版本不对 if not defined npm_config_node_gyp (node "C:\Users\Administrator\AppData\Roa ...
- Windows环境下npm install常见错误
Windows环境下npm install安装包依赖时,常出现一些错误,下面为个人解决办法: 错误一 缺少python环境: G:\nodejs\moviesite\node_modules\bcry ...
- node.js的npm命令常见错误及解决方案
使用npm命令进行模块安装的时候场出现各种错误,本文总结我所遇到的各种错误,并提供解决方案.(大部分内容为网上收集) 首先使用淘宝 NPM 镜像 大家都知道国内直接使用 npm 的官方镜像是非常慢的, ...
- npm install mongoose错误解决
今天安装mongoose一直报错,上图 具体的错误记录: info it worked if it ends with ok verbose cli [ 'C:\\Program Files\\nod ...
- Python学习笔记: pip install 常见错误汇总
本机环境RHEL8, Python3.9 pip install: 无法安装最新版本的包 在pypi上查看pkg的页面,因为有些pip包的版本对特定的python版本有要求 pip install e ...
- npm install依赖时,常见错误
1.npm install依赖时,报错:npm ERR! Unexpected end of JSON input while parsing near '...gin":"^1. ...
- 笔记:npm常见错误
常见错误 破坏的npm安装 随机错误 找不到兼容版本 权限错误 Error: ENOENT, stat 'C:\Users\<user>\AppData\Roaming\npm' 在Win ...
- centos linux 系统日常管理4 scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法 第十七节课
centos linux 系统日常管理4 scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法 第十七节课 rsync可以增量同步,scp不行 ...
- npm 安装 electron 出现的奇葩错误
起因 使用yarn安装electron有时稳定,在搭配别的框架时有时又出现无解的错误了,于是打开electron官网,发现: emm,似乎官方对npm情有独钟.于是我遵从官方旨意使用npm安装elec ...
随机推荐
- 转:领域模型中的实体类分为四种类型:VO、DTO、DO、PO
经常会接触到VO,DO,DTO的概念,本文从领域建模中的实体划分和项目中的实际应用情况两个角度,对这几个概念进行简析.得出的主要结论是:在项目应用中,VO对应于页面上需要显示的数据(表单),DO对应于 ...
- luogu P3572 [POI2014]PTA-Little Bird |单调队列
从1开始,跳到比当前矮的不消耗体力,否则消耗一点体力,每次询问有一个步伐限制,求每次最少耗费多少体力 #include<cstdio> #include<cstring> #i ...
- luogu P1731 [NOI1999]生日蛋糕 |暴力枚举
题目背景 7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层 生日蛋糕,每层都是一个圆柱体. 设从下往上数第i(1<=i<=M)层蛋糕是半径为Ri, 高度为Hi的圆柱 ...
- javascript数据类型和类型转换
一 数据类型 1)typeof 查看数据类型 1.number 数字 取值范围:正无穷 - 负无穷.NaN 正无穷:Number.POSITIVE_INFINITY 负无穷:Number.NEGAT ...
- 2018HDU多校二 -F 题 Naive Operations(线段树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6315 In a galaxy far, far away, there are two integer ...
- 洛谷 题解 P5015 【标题统计】 NOIP2018 普及组 T1
没有人用 scanf("%c", &ch) != EOF 吗? scanf 和 EOF 会伤心的. 思路:逐个读入字符,遇到EOF中止,对于每个读入的字符进行判断. 附上考 ...
- 使用flink实现一个topN的程序
topN功能是一个非常常见的功能,比如查看最近几分钟的阅读最高数,购买最高数. flink实现topN的功能也非常方便,下面就开始构建一个flink topN的程序. 还是像上篇博客一样,从kafka ...
- Pyhton表白代码——浪漫圣诞节
圣诞节即将到了,所以这回通过turtle模块来编写一个表白的小程序 开发时间:2019-12-15 开发工具:Sublime 开发模块:turtle 这里用到了turtle库的相关知识,如果不熟悉可以 ...
- 使用iCamera 测试MT9M001 130w高分辨率摄像头说明
该摄像头默认分辨率为1280*1024,即不设置任何寄存器参数,只要给该模块提供时钟,就可以输出. 在这里 我们可以通过右侧寄存器栏动态调整各寄存器 观察效果. 0x09寄存器可以调整曝光值,可以根据 ...
- Hadoop HDFS 源码解析记录
版权说明: 本文章版权归本人及博客园共同所有,转载请标明原文出处( https://www.cnblogs.com/mikevictor07/p/12047502.html ),以下内容为个人理解,仅 ...