TypeError: cb.apply is not a function 解决gitbook报错问题

发布时间 2023-09-04 12:16:20作者: 九尾cat

TypeError: cb.apply is not a function 解决gitbook报错问题

编译报错内容

报错信息如下:

/usr/lib/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 /usr/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18

 查看gitbook版本依旧报错:

 

解决方案

经过查找发现是nodejs版本的问题,我当前版本为v16.13.0,降到v14.20也不行,最终测试通过版本为v10.24.1编译构建成功,解决问题

 成功版本如下: