简体   繁体   English

gitbook init 错误:TypeError [ERR_INVALID_ARG_TYPE]:“数据”参数必须是

[英]gitbook init Error: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be

node: v14.0.0节点:v14.0.0

CLI version: 2.3.2命令行版本:2.3.2

GitBook version: 3.2.3 GitBook 版本:3.2.3

Windows10 Windows10

When execute gitbook init in an empty folder, it pops up:在空文件夹中执行gitbook init时,弹出:

$ gitbook init
warn: no summary file in this book
info: create SUMMARY.md

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Promise

And there is no "SUMMARY.md" created... How could it be fixed?Thanks!而且没有创建“SUMMARY.md”...怎么解决?谢谢!

I have the same problem just as you.我和你有同样的问题。 Switch back from latest node version to 12.18.1 LTS.从最新的节点版本切换回 12.18.1 LTS。

And everything gonna be ok.一切都会好起来的。

Do you want to convert markdown files to an e-book?是否要将 markdown 文件转换为电子书? If so, pandoc is an alternative.如果是这样, pandoc是一个替代方案。

pandoc -o js_functional.epub --metadata title="Functional JavaScript" *.md pandoc -o js_functional.epub --metadata title="Functional JavaScript" *.md

If you want mobi format, calibre is a good converter.如果你想要 mobi 格式, calibre是一个很好的转换器。

npm install -g gitbook-summary and cd to your target directory, run "book sm" Summary will be resolved. npm install -g gitbook-summary and cd 到你的目标目录,运行“book sm” Summary 就会解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM