Java基础、中级、高级、架构面试资料

GitBook 编译,生成pdf报错

业余杂谈 herman 10675浏览 0评论
公告:“业余草”微信公众号提供免费CSDN下载服务(只下Java资源),关注业余草微信公众号,添加作者微信:xttblog2,发送下载链接帮助你免费下载!
本博客日IP超过2000,PV 3000 左右,急需赞助商。
极客时间所有课程通过我的二维码购买后返现24元微信红包,请加博主新的微信号:xttblog2,之前的微信号好友位已满,备注:返现
受密码保护的文章请关注“业余草”公众号,回复关键字“0”获得密码
所有面试题(java、前端、数据库、springboot等)一网打尽,请关注文末小程序
视频教程免费领
腾讯云】1核2G5M轻量应用服务器50元首年,高性价比,助您轻松上云

最近在使用 GitBook 生成静态网页和pdf文件时,百度,谷歌了很久也没有类似的解决方案,最近发现是版本问题,我把我的相关经验分享给大家!

在执行 gitbook build ,gitbook serve,gitbook pdf等命令均保持。报错了错误提示内容如下:

info: 10 plugins are installed
info: 9 explicitly listed
info: loading plugin "baidu"... OK
info: loading plugin "donate"... OK
info: loading plugin "sitemap"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 24 pages
info: found 2 asset files
warn: "options" property is deprecated, use config.get(key) instead
warn: "options.generator" property is deprecated, use "output.name" instead
error: error while generating page "README.md":

TypeError: this.contentPath is not a function

当然也有些网友的报错内容如下:

warn: "options" property is deprecated, use config.get(key) instead
warn: "page.progress" property is deprecated
warn: "sections" property is deprecated, use page.content instead
TypeError: Path must be a string. Received undefined

这种问题的原因是,gitbook的版本太低。大家执行 gitbook update 命令进行升级,升级到3.2.2版本即可。

也有网友反映,报一下的错:

Error: Couldn't locate plugins "baidu, donate", Run 'gitbook install' to install plugins from registry.

这是提示插件没有安装的错误。大家执行 gitbook install 命令完成安装即可。

业余草公众号

最后,欢迎关注我的个人微信公众号:业余草(yyucao)!可加作者微信号:xttblog2。备注:“1”,添加博主微信拉你进微信群。备注错误不会同意好友申请。再次感谢您的关注!后续有精彩内容会第一时间发给您!原创文章投稿请发送至532009913@qq.com邮箱。商务合作也可添加作者微信进行联系!

本文原文出处:业余草: » GitBook 编译,生成pdf报错