当前位置: 首页 > 工具软件 > graceful > 使用案例 >

使用gitbook时graceful-fs报错:TypeError: cb.apply is not a function的解决方案

沈凯康
2023-12-01

查看gitbook版本gitbook -V报错:

/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
    at FSReqCallback.oncomplete (fs.js:184:5)

是graceful-fs版本的问题,切换到node_modules目录下重新安装这个项目。
cd /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules

sindweller@xindeweiladeMacBook-Pro node_modules % npm install graceful-fs@la
test --save
npm notice created a lockfile as package-lock.json. You should commit this file.
+ graceful-fs@4.2.9
updated 1 package and audited 395 packages in 1.465s
found 77 vulnerabilities (7 low, 34 moderate, 31 high, 5 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

然后gitbook版本可以查看。

 类似资料: