pysama
V2EX  ›  Node.js

electron 全局安装的时候卡在 postinstall 了,有遇到的同学不?

  •  
  •   pysama · Dec 15, 2016 · 14277 views
    This topic created in 3610 days ago, the information mentioned may be changed or developed.

    npm i electron -g

    [email protected] postinstall /usr/local/lib/node_modules/electron-prebuilt
    node install.js
    

    然后就一直卡住了。

    我的 node 已经升到最新版本了 6.9.2. OS 是 mac 。 github 中的 issue 上有同样的问题,但是没有人回复。。

    10 replies  •  2017-12-30 14:56:21 +08:00
    cbais7890
    cbais7890
    Dec 15, 2016
    1
    我记得安装时他会下载对应系统版本的包到电脑上, 一个好几百兆, 如果是卡在这里的话, 换个国内的源或许会好点
    acecode
    acecode
    Dec 16, 2016
    2
    加一个淘宝镜像设置试试

    ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ npm install -g electron
    wxx199101046
    wxx199101046
    Dec 16, 2016❤️1
    3
    用 cnpm i 通常能解决这类问题
    pysama
    pysama
    OP
    Dec 16, 2016
    4
    @acecode 试过了,不行。谢谢
    @cbais7890 我一直使用 tb 的镜像
    pysama
    pysama
    OP
    Dec 16, 2016
    5
    @wxx199101046 搞定了,太感谢你了。
    wxx199101046
    wxx199101046
    Dec 16, 2016
    6
    @pysama My pleasure
    nullsuperman
    nullsuperman
    Apr 17, 2017
    7
    @pysama
    @wxx199101046 请问是怎么解决的 我用了 cnpm I electron -g 还是一样卡在那里
    pysama
    pysama
    OP
    May 11, 2017
    8
    @HoHoibin 我前面说了, 用 cnpm 搞定的
    nullsuperman
    nullsuperman
    May 12, 2017
    9
    @pysama 嗯,已经解决了,最后用了 Proxifier 全局代理后就好了。
    DuXing
    DuXing
    Dec 30, 2017
    10
    根据 @acecode 的提示,通过一下方式成功:
    > set ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron
    > npm i --registry=https://registry.npm.taobao.org
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4248 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 01:07 · PVG 09:07 · LAX 17:07 · JFK 20:07
    ♥ Do have faith in what you're doing.