gitbook init Error: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be
Asked Answered
E

3

5

node: v14.0.0

CLI version: 2.3.2

GitBook version: 3.2.3

Windows10

When execute gitbook init in an empty folder, it pops up:

$ 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!

Encomium answered 1/5, 2020 at 7:56 Comment(3)
I received the same error on my setup with Node 14.1.0. However, gitbook build and gitbook serve commands work anyway. Have you tried to build your docs with gitbook build? Any errors?Shelbyshelden
gitbook build and gitbook serve commands work fine. But gitbook init goes wrong, and I can't manage the summary of the book... I have to turn to use Docsify, which is pretty good as well.Encomium
gitbook init creates readme.md and summary.md files, nothing more. If the command fails, you can create SUMMARY.md manually and use gitbook build to build your docs. Anyway, switching to a modern static-site generator is a good idea, as GitBook is heavily outdated (more than 2 years).Shelbyshelden
A
7

I have the same problem just as you. Switch back from latest node version to 12.18.1 LTS.

And everything gonna be ok.

Atrocity answered 22/6, 2020 at 12:24 Comment(1)
I want you to know I know the truth, of course I know it... I would be nothing without you... Did you ever know that you're my hero?Wetnurse
M
0

Do you want to convert markdown files to an e-book? If so, pandoc is an alternative.

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

If you want mobi format, calibre is a good converter.

Mahatma answered 24/8, 2021 at 9:2 Comment(0)
D
0

npm install -g gitbook-summary and cd to your target directory, run "book sm" Summary will be resolved.

Diffusivity answered 22/4, 2022 at 2:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.