需求:
- 在使用gitBook-cli 的时候初始化直接报错
- TypeError: cb.apply is not a function
进程:
- 解决方案,npm 降级,node 使用 10.14.1 的就可以正常使用
- 修改全局的gitBook 内置函数
- vim /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js 注释 62,63,64 行
- 重新run gitbook init
- 查看是否成功 gitbook -V
- 启动gitbook build
拓展:
- gitbook build 的时候界面上需要两个文件,README.md SUMMARY.md
- summary 是目录文件两者缺一不可