V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
pysama
V2EX  ›  Node.js

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

  •  
  •   pysama · Dec 15, 2016 · 13760 views
    This topic created in 3424 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
        1
    cbais7890  
       Dec 15, 2016
    我记得安装时他会下载对应系统版本的包到电脑上, 一个好几百兆, 如果是卡在这里的话, 换个国内的源或许会好点
    acecode
        2
    acecode  
       Dec 16, 2016
    加一个淘宝镜像设置试试

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