V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
dyxang
V2EX  ›  问与答

Gitbook 一直安装失败

  •  
  •   dyxang · Aug 26, 2020 · 4142 views
    This topic created in 2082 days ago, the information mentioned may be changed or developed.

    Windows 在文档目录下运行gitbook init安装,结果弹错误:

    Installing GitBook 3.2.3
    C:\Users\XXX\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js:287
          if (cb) cb.apply(this, arguments)
                     ^
    
    TypeError: cb.apply is not a function
        at C:\Users\XXX\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18
        at FSReqCallback.oncomplete (fs.js:177:5)
    

    急死了,不会用,有无能解决问题的老哥帮帮我

    7 replies    2021-01-19 22:11:43 +08:00
    kaqiuqiu
        1
    kaqiuqiu  
       Aug 26, 2020   ❤️ 2
    最新版的 nodejs 更新了 fs 某个特性(包括 LTS 版 和 14+ 版).
    临时解决办法:往前退一个小版本,例如用 12.18.2 版本.
    dyxang
        2
    dyxang  
    OP
       Aug 26, 2020
    @kaqiuqiu 好的谢谢,我还是静静等待更新吧
    raaaaaar
        3
    raaaaaar  
       Aug 26, 2020 via Android
    日常推荐 mdbook 。。
    dyxang
        4
    dyxang  
    OP
       Aug 28, 2020 via Android
    @raaaaaar 作为一个菜鸟来说,哪个本地化做得好用哪个,这个我也去看看
    fcmio
        5
    fcmio  
       Sep 24, 2020
    @kaqiuqiu 感谢。。。😂
    Meli55a
        6
    Meli55a  
       Jan 19, 2021   ❤️ 1
    根据报错信息,找到 polyfills.js ,注释 62-64 行即可安装,亲测

    Node.js:v14.15.4.
    CLI version: 2.3.2
    GitBook version: 3.2.3
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2754 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 15:34 · PVG 23:34 · LAX 08:34 · JFK 11:34
    ♥ Do have faith in what you're doing.