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

253 阅读1分钟

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

CI前端gitbook编译报错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编译构建成功,解决问题

 成功版本如下: