How to Resolve a \"cb.apply is not a function\" Error in Gitbook
I regularly use Gitbook, a Node.js software that converts a set of markdown files into an ebook. Recently, while trying to generate a PDF using the command gitbook pdf ., I encountered a strange error: ➜ ebook git:(master) ✗ gitbook pdf . /usr/local/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/local/lib/node\_modules/gitbook-cli/node\_modules/npm/node\_modules/graceful-fs/polyfills.js:287:18 The error message “cb.apply is not a function” left me wondering about its meaning and why it occurred at that moment....