random errors when using gitbook plugin on running "gitbook serve"错误

在使用(gitbook

gitbook serve

报以下随机错误

We are running gitbook with some plugins. Plugins are loaded fine but at the end it errors out with different error messages. All of them complains about one or the other plugin file missing. Running gitbook version 2.1.3 on windows 7.

info: 7 plugins are installed
info: loading plugin "prism"... OK
info: loading plugin "edit-link"... OK
info: loading plugin "livereload"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 66 pages
info: found 83 asset files

Error: ENOENT: no such file or directory, stat 'C:\Projects\myproject_book\gitbook\gitbook-plugin-fontsettings\buttons.js'

Error: ENOENT: no such file or directory, stat 'C:\Projects\myproject_book\gitbook\gitbook-plugin-lunr\lunr.min.js'

Error: ENOENT: no such file or directory, stat 'C:\Projects\myproject_book\gitbook\gitbook-plugin-livereload\plugin.js'

在这里插入图片描述
经搜索定位,发现 github 上有这个 issue,感觉这个因为环境不同出错情况挺普遍,也换了最新的 nodejs 版本,还是类似的错误。

再细看 issue提醒:
Steps:

1、Edit file: C:\Users[user].gitbook\versions\3.2.3\lib\output\website\copyPluginAssets.js
2、Modify in two places copyAssets(output, plugin) and copyResources(output, plugin), the line:

confirm: true

by

confirm: false

在这里插入图片描述

成功解决!!

扫描二维码关注公众号,回复: 4974156 查看本文章

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_41593408/article/details/86483188