dyxang
V2EX  ›  问与答

Gitbook 一直安装失败

  •  
  •   dyxang · Aug 26, 2020 · 4677 views
    This topic created in 2267 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
    kaqiuqiu
    Aug 26, 2020❤️2
    1
    最新版的 nodejs 更新了 fs 某个特性(包括 LTS 版 和 14+ 版).
    临时解决办法:往前退一个小版本,例如用 12.18.2 版本.
    dyxang
    dyxang
    OP
    Aug 26, 2020
    2
    @kaqiuqiu 好的谢谢,我还是静静等待更新吧
    raaaaaar
    raaaaaar
    Aug 26, 2020 via Android
    3
    日常推荐 mdbook 。。
    dyxang
    dyxang
    OP
    Aug 28, 2020 via Android
    4
    @raaaaaar 作为一个菜鸟来说,哪个本地化做得好用哪个,这个我也去看看
    fcmio
    fcmio
    Sep 24, 2020
    5
    @kaqiuqiu 感谢。。。😂
    ErgeAIA
    ErgeAIA
    Jan 19, 2021❤️1
    6
    根据报错信息,找到 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   ·   Privacy   ·   Solana   ·   954 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 19:48 · PVG 03:48 · LAX 11:48 · JFK 14:48
    ♥ Do have faith in what you're doing.