Loading

gitbook build/serve 失败,Error: ENOENT: no such file or directory, stat ...

我使用的 gitbook 版本

CLI version: 2.3.2
GitBook version: 3.2.3

在使用 gitbook 生成文档时,发现编译偶尔不规律性地出现错误

d:\Mine\doc>gitbook serve
Live reload server started on port: 35729
Press CTRL+C to quit ...

info: 11 plugins are installed
info: 8 explicitly listed
info: loading plugin "alerts"... OK
info: loading plugin "tbfed-pagefooter"... OK
info: loading plugin "fancybox"... OK
info: loading plugin "insert-logo-link"... OK
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 11 pages
info: found 23 asset files

Error: ENOENT: no such file or directory, stat 'd:\Mine\doc.gitbook\_book\gitbook\gitbook-plugin-fontsettings\fontsettings.js'

而且每次出现的错误文件还可能不一样,实在是头疼得很,每次修改要编译多次才能成功

google 后,在 gitbook 的 issue 中找到答案。

解决方法

修改 C:\Users\Administrator\.gitbook\versions\3.2.3\lib\output\website\copyPluginAssets.js 文件中的 112 行

copyPluginAssets.js

confirm: true 改为 confirm: false

posted @ 2018-08-15 17:12  辉灬  阅读(2117)  评论(0编辑  收藏  举报