【问题标题】:electron install error : Failed at the electron@1.4.6 postinstall script 'node install.js'电子安装错误:在 electron@1.4.6 安装后脚本“node install.js”失败
【发布时间】:2017-03-29 07:16:27
【问题描述】:

我正在尝试安装电子最新版本并遇到此错误。我尝试安装 sudo 并降级到电子 1.4.5 但此错误仍然存​​在。我使用的节点版本是v7.1.0

完整的错误日志

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/Cellar/node/6.6.0/bin/node" "/usr/local/bin/npm" "install" "-g" "electron@1.4.5" "--verbose"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.7
npm ERR! code ELIFECYCLE

npm ERR! electron@1.4.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@1.4.5 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron 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 information on how to open an issue for this project with:
npm ERR!     npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electron
npm ERR! There is likely additional logging output above.

【问题讨论】:

    标签: node.js npm electron


    【解决方案1】:

    原来是我使用的node 版本有问题。可能电子与发布的较新版本的节点不兼容。

    我已经安装了nvm 并安装了较低版本的节点。在我的情况下v6.3.0。之后我就可以毫无错误地安装电子了。

    【讨论】:

    • 遇到了同样的问题。通过升级节点和 npm 修复。 10x @Penkey Suresh
    【解决方案2】:

    在使用 sudo 时也遇到了同样的问题。 当我切换到 root 时,安装成功了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-21
      • 2020-10-19
      • 2021-10-14
      • 2020-01-25
      • 2018-11-06
      • 1970-01-01
      • 2020-06-27
      • 2018-11-23
      相关资源
      最近更新 更多