大佬教程收集整理的这篇文章主要介绍了Electron npm install 常见错误(Linux),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Ubuntu 12.04 (32bit)
@H_673_23@安装Git
sudo apt-get install git
@H_673_23@安装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官网下。
@H_673_23@编译源码
错误一: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.
PS:因为安装过程复制且不顺利,就不走这条路。
@H_673_23@低版本的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
@H_673_23@electron npm install
@H_673_23@错误一: ../../../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 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
@H_673_23@错误二:make: cc: Command not found
解决:
sudo ln -s /usr/bin/gcc-4.9 /usr/bin/cc
@H_673_23@错误三:/usr/bin/ld: cAnnot find -lcrypto
@H_673_23@错误四:error: ‘memcpy‘ was not declared in this scope
原因:node插件源码报错了,其实解决办法很容易,到程序中加上头文件String.h就好了,就是 #include<String.h>
@H_673_23@electron rebuild
@H_673_23@错误一: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 (方法一)
@H_673_23@错误二:error while loading shared libraries: libXss.so.1: cAnnot open shared object file: No such file or directory
解决:
sudo apt-get install libxss1
@H_673_23@错误三: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这个依赖,总是报未找到匹配软件包!!!
@H_673_23@总结
Electron rebuild到上面最后的一个错,就走不下去了,那个缺失的库始终无法安装,也就是Ubuntu 12.04 上运行Electron宣告失败。
Ubuntu12.04 试了两天,太心累了,系统缺失的库太多了且有装不上的。
最后,我更换Ubuntu16.04 做尝试,却很快成功跑起Electron。它仅仅缺失一个库,上面大部分错误都没有出现。不过要注意Node使用10版本、gcc使用4.9就行了,使用Node 12、gcc 5都会报错的。
以上是大佬教程为你收集整理的Electron npm install 常见错误(Linux)全部内容,希望文章能够帮你解决Electron npm install 常见错误(Linux)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。