# 0x01：引子

Installing GitBook 3.2.3
CXX(target) Release/obj.target/fse/fsevents.o
CXX(target) Release/obj.target/fse/fsevents.o
/usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287
if (cb) cb.apply(this, arguments)
^

TypeError: cb.apply is not a function
at /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
at FSReqCallback.oncomplete (fs.js:184:5)

at /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18

# 0x02：历程

sudo vim /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js

fs.stat = statFix(fs.stat)
fs.fstat = statFix(fs.fstat)
fs.lstat = statFix(fs.lstat)

//fs.stat = statFix(fs.stat)
//fs.fstat = statFix(fs.fstat)
//fs.lstat = statFix(fs.lstat)

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

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

And everything gonna be ok.

info: create SUMMARY.md
info: initialization is finished

InstallRequiredError: "ebook-convert" is not installed.
Install it from Calibre: https://calibre-ebook.com

sudo vim ~/.zshrc

export PATH="/Applications/calibre.app/Contents/MacOS:\$PATH"

source ~/.zshrc

此时测试，ebook-convert指令，命令行执行：ebook-convert

Usage: ebook-convert input_file output_file [options]

Convert an e-book from one format to another.

input_file is the input and output_file is the output. Both must be specified as the first two arguments to the command.

The output e-book format is guessed from the file extension of output_file. output_file can also be of the special format .EXT where EXT is the output file extension. In this case, the name of the output file is derived from the name of the input file. Note that the filenames must not start with a hyphen. Finally, if output_file has no extension, then it is treated as a folder and an "open e-book" (OEB) consisting of HTML files is written to that folder. These files are the files that would normally have been passed to the output plugin.

After specifying the input and output file you can customize the conversion by specifying various options. The available options depend on the input and output file types. To get help on them specify the input and output file and then use the -h option.

For full documentation of the conversion system see
https://manual.calibre-ebook.com/conversion.html

Whenever you pass arguments to ebook-convert that have spaces in them, enclose the arguments in quotation marks. For example: "/some path/with spaces"

Options:
--version       show program's version number and exit

-h, --help      show this help message and exit

--list-recipes  List builtin recipe names. You can create an e-book from a
builtin recipe like this: ebook-convert "Recipe Name.recipe"
output.epub

Created by Kovid Goyal <kovid@kovidgoyal.net>

info: 7 plugins are installed
info: 6 explicitly listed
info: found 9 pages
info: found 0 asset files
info: >> generation finished with success in 14.0s !
info: >> 1 file(s) generated 

# 0x03：后记

CSDN深度学习博客专家以及微信公众号《简明AI》主要作者。创作内容是基于深度学习的理论学习与应用开发技术分享，致力于最简单明了AI技术分享与最实用AI应用教程。

05-17
07-18 14万+
12-25 656
11-29 2万+
07-19 648