node.js - 在ubuntu上安装electron

标签 node.js ubuntu electron

当我尝试使用

在 Ubuntu 15.04 上安装 Electron 时

sudo npm install electron-prebuilt -g

这是我得到的

/usr/local/bin/electron -> /usr/local/lib/node_modules/electron-prebuilt/cli.js

> electron-prebuilt@0.28.3 postinstall /usr/local/lib/node_modules/electron-prebuilt
> node install.js

Downloading electron-v0.28.3-linux-x64.zip
Error: tunneling socket could not be established, cause=139936635598656:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:795:


/usr/local/lib/node_modules/electron-prebuilt/install.js:15
  throw err
        ^
Error: tunneling socket could not be established, cause=139936635598656:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:795:

npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! electron-prebuilt@0.28.3 postinstall: `node install.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the electron-prebuilt@0.28.3 postinstall script.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.19.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "electron-prebuilt"
npm ERR! cwd /usr/bin
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/bin/npm-debug.log
npm ERR! not ok code 0

我试过了

使用以下命令为 Node 创建系统链接: /usr/bin/文件夹下的ln -s node nodejs

安装 node-legacy 包:sudo apt-get install node-legacy 按照建议here 没有运气。

在其他论坛上找不到更多内容。所以请帮忙。 提前致谢。

最佳答案

以下步骤对我有用: (假设已经安装了 node 和 npm)

  1. 将 npm 包更新到最新:-

    sudo npm install npm@latest -g

  2. 安装了带有以下开关的 Electron :

    sudo npm install electron -g --verbose --unsafe-perm=true --allow-root

随时欢迎有经验的人提出更正/建议。希望它对某人有所帮助。

关于node.js - 在ubuntu上安装electron,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31162671/

相关文章:

javascript - 如何为每个端点和 REST 方法设置不同的 Passport JS Bearer 策略?

node.js - 使用 Express JS 检查 API 请求授权的更好方法

c - 在C中的系统默认应用程序中打开文件

node.js - Electron 将 BrowserWindow 传递给外部主函数(不是 IPC)

node.js - Prisma:使用具有非唯一字段的 "where"进行更新?

javascript - 无法从文件名探测 mimetype

c - 什么是 ubuntu 中的 EOF 以及 Kernighan 和 Ritchie

Eclipse mars 图标未在 Ubuntu 14.04 上显示

javascript - 如何在 Electron 应用程序中配置 Chart.js?

javascript - Electron 中的 renderer.js 有什么特别之处吗?