» npm install gitbook-cli
» npm install @gitbook/cli
» npm install gitbook
» npm install @feedzai/gitbook-cli
» npm install @pharrellwang/gitbook-cli
» npm install @0y0/gitbook-cli
The issue was originally a problem inside graceful-fs but they solved it in this commit I believe.
The problem is that GitBook is still using outdated dependencies that pull in versions of graceful-fs without the fix.
The solution I found was to update graceful-fs inside gitbook like this:
If you've installed gitbook globally by doing npm install -g gitbook-cli then your path in macOS should be something like /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules. Your path may differ depending on your OS or installation location.
Run this:
cd /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/
npm install graceful-fs@latest --save
Then try installing GitBook. It should have fixed the installing problem.
TL;DR
Why not switch to honkit(Fork of GitBook)?
The "why" for switching:
I knew this is not the answer to the question, but I would like to mention that the repository of gitbook has been deprecated 3 years ago, this makes it a bad choice for usage and especially security.
So I searched for the alternatives, and I found mdBook and honkit, turned out that honkit has good compatibility with gitbook, maybe switch to honkit is a better choice instead of fixing a 3 years old software with some hacking.
» npm install emanual-gitbook-cli