最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

【已解决】gitbook出错:npm node_modules graceful-fs polyfills.js TypeError cb.apply is not a function

gitbook crifan 337浏览 0评论
折腾:
【未解决】gitbook安装和使用插件autocover给生成的pdf文件加上封面
期间,去
make deubg
期间gitbook报错:
gitbook --port 4000 --lrport 35729 serve /Users/xxx/dev/crifan/gitbook/gitbook_template/books/python_newbie_mistakes_questions /Users/xxx/dev/crifan/gitbook/gitbook_template/generated/books/python_newbie_mistakes_questions/debug --log debug
Live reload server started on port: 35729
Press CTRL+C to quit ...


debug: readme found at README.md 
debug: summary file found at SUMMARY.md 
debug: cleanup folder "/Users/xxx/dev/crifan/gitbook/gitbook_template/generated/books/python_newbie_mistakes_questions/debug" 
/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 (node:fs:195:5)
make: *** [debug] Error 1
polyfills.js TypeError cb.apply is not a function
All my react-native projects shows error TypeError: cb.apply is not a function – Stack Overflow
试试:
npm install graceful-fs --save-dev
log
 npm install graceful-fs --save-dev

added 1 package, and removed 74 packages in 2s
结果:
问题依旧。
android – TypeError: cb.apply is not a function – Stack Overflow
 node -v       v15.6.0
 npm -v7.4.0
node.js – Gitbook-cli install error TypeError: cb.apply is not a function inside graceful-fs – Stack Overflow
cd /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules
npm install graceful-fs@latest --save
log
cd /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/
 npm install graceful-fs@latest --save
npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated har-validator@2.0.6: this library is no longer supported
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated ignore@2.2.19: several bugs fixed in v3.2.1
npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)


added 271 packages, and changed 3 packages in 11s
结果:
解决了问题。
【总结】
此处是gitbook下面的npm中的插件graceful-fs报错的:
/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
而这个错误是:graceful-fs
之前的老版本的错误。最新版已修复。
解决办法:
去给gitbook-cli中安装最新版的graceful-fs
步骤:
cd /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/
npm install graceful-fs@latest --save
即可。

转载请注明:在路上 » 【已解决】gitbook出错:npm node_modules graceful-fs polyfills.js TypeError cb.apply is not a function

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
18 queries in 0.080 seconds, using 9.40MB memory