Electron npm installよくあるエラー(Linux)

5348 ワード

Linuxバージョン
Ubuntu 12.04 (32bit)
インストールGit
sudo apt-get install git

ssh keyの生成
#     sshkey
cd ~/.ssh
#  
ssh-keygen
#  
cat ~/.ssh/id_rsa.pub

nodeのインストール
バイナリ・ファイルの使用
エラー1:./node: cannot execute binary file
理由は次のとおりです.
1、root以外のユーザーまたは実行権限なし
2、コンパイル環境が違う(プログラムは他の操作環境からコピーしてくる)
PS:https://blog.51cto.com/1381479/888198
エラー2: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
ソースコードのコンパイル
エラー1: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
エラー1:..//..//...../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

エラー2:make:cc:Command not found
解決:
sudo ln -s  /usr/bin/gcc-4.9 /usr/bin/cc

エラー3:/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

エラー4:error:'memcpy'was not declared in this scope
原因:nodeプラグインのソースコードが間違っています.実は解決方法が簡単で、プログラムにヘッダファイルstringを追加します.hでいい、include
electron rebuild
エラー1: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(方法一)
エラー2:error while loading shared libraries:libXss.so.1: cannot open shared object file: No such file or directory
解決:
sudo apt-get install libxss1

エラー3:error while loading shared libraries:libatk-bridge-2.0.so.0: cannot open shared object file: No such file or directory
しばらく解けません:ずっとinstallできませんlibatk-bridge 2.0-0この依存は、常に一致するパッケージが見つかりません!!!
まとめ
Electron rebuildは上の最後の間違いで、歩けなくなり、その欠落したライブラリはインストールできなくなりました.つまり、Ubuntu 12.04でElectronを実行して失敗を宣言しました.
Ubuntu12.04 2日間試してみたが、心が疲れて、システムが欠けているライブラリが多すぎて、入れられないものがあった.
最後にUbuntu 16を交換する.04やってみたが、すぐにElectronを走ることに成功した.ライブラリが1つしか欠けていません.ほとんどのエラーは発生しません.ただし、Nodeは10バージョン、gccは4.9を使用すればよいので、Node 12、gcc 5を使用するとエラーが発生します.