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.

Answer from Ariel Mirra on Stack Overflow
🌐
npm
npmjs.com › package › gitbook-cli
gitbook-cli - npm
gitbook-cli store GitBook's versions into ~/.gitbook, you can set the GITBOOK_DIR environment variable to use another directory. ... Run command gitbook build, gitbook serve (read GitBook documentation for details). ... By default, GitBook CLI will read the gitbook version to use from the book configuration, but you can force a specific version using --gitbook option:
      » npm install gitbook-cli
    
Published: Jul 14, 2017
Version: 2.3.2
Author: FriendCode Inc.
🌐
GitHub
github.com › GitbookIO › gitbook-cli › issues › 74
Gitbook install/init fails · Issue #74 · GitbookIO/gitbook-cli
October 19, 2017 - I'm trying to install and use gitbook-cli for the first time and am seeing an issue getting it running. I've seen #68 issue but the solutions in the issue don't appear to work for me. I'm not finding any node/npm compatibility details in...
Author: GitbookIO
🌐
Stack Overflow
stackoverflow.com › questions › 45049768 › gitbook-cli-install-error-gitbook-cli-v-cannot-be-use
node.js - gitbook-cli install error, gitbook-cli -v cannot be use - Stack Overflow
Also, I don't think it is a good idea to launch gitbook as root user. ... npm cache clean -f npm install -g n n stable ln -sf /usr/local/n/versions/node/8.0.0/bin/node /usr/bin/node ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... 8 'node' is not ...
🌐
npm
npmjs.com › package › @gitbook › cli
@gitbook/cli - npm
February 13, 2026 - The GitBook Development CLI requires Node v18 or later. It can be installed from NPM using:
      » npm install @gitbook/cli
    
Published: Feb 13, 2026
Version: 0.27.2
🌐
GitHub
github.com › GitbookIO › gitbook-cli › issues › 110
Gitbook build stopped to work in node 12.18.3 · Issue #110 · GitbookIO/gitbook-cli
July 29, 2020 - You must be signed in to change notification settings · Fork 208 · Star 729 · New issueCopy link · New issueCopy link · Open · Open · Gitbook build stopped to work in node 12.18.3#110 · Copy link · mikyjpeg · opened · on Jul 29, 2020 · Issue body actions · Since the new version of node, when running gitbook build it fails with the following error: Installing GitBook 3.2.3 /home/travis/.nvm/versions/node/v12.18.3/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 /home/travis/.nvm/versions/node/v12.18.3/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18 at FSReqCallback.oncomplete (fs.js:169:5) The command "gitbook install" failed and exited with 1 during .
Author: GitbookIO
🌐
GitHub
github.com › GitbookIO › gitbook-cli › issues › 68
gitbook-cli@2.3.1 fails to run gitbook init · Issue #68 · GitbookIO/gitbook-cli
July 12, 2017 - # node -v v8.1.4 # npm -v 5.0.3 # npm install -g gitbook-cli@2.3.1 # gitbook fetch # gitbook --version CLI version: 2.3.1 GitBook version: 3.2.2 # gitbook init Error loading version latest: Error: Cannot find module 'extend' at Function.Module._resolveFilename (module.js:485:15) at Function.Module._load (module.js:437:25) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/root/.gitbook/versions/3.2.2/lib/index.js:1:76) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) TypeError: Cannot read property 'commands' of null
Author: GitbookIO
🌐
Marslo
marslo.github.io › ibook › tools › node › gitbook.html
gitbook · ibook
May 21, 2026 - Gitbook uses npmi, which requires npm-global, and npm-global further requires the currently installed npm on your machine. $ npm config set strict-ssl false $ npm config set proxy $http_proxy -g $ npm config set https-proxy $https_proxy -g ... > [!NOTE] > tip <br> > tip <br> // or > ...
🌐
secretGeek
til.secretgeek.net › gitbook › use_gitbook_locally.html
Use gitbook locally - Today I Learned - secretGeek.net
You need to install "gitbook-cli" ... need to uninstall it. >> Run "npm uninstall -g gitbook" then "npm install -g gitbook-cli" Once gitbook-cli is installed, thereafter, from the root of the repo you're working on, you run......
Find elsewhere
🌐
GitHub
github.com › GitbookIO › gitbook-cli › issues › 89
gitbook serve throws Cannot find module 'internal/util/types' error · Issue #89 · GitbookIO/gitbook-cli
December 3, 2018 - I managed to install a latest version of graceful-fs (4.1.15) , replace the old version(3.0.5) under .gitbook\versions\2.5.2\npm\node_modules\ with it, it works! though I am not much familiar with Node.js , but suspect the required version of graceful-fs is too old to be compatible with latest node.js npm, maybe do an upgrading? node -v v10.14.1 npm -v 6.4.1 gitbook -V CLI version: 2.3.2 GitBook version: 2.5.2
Author: GitbookIO
🌐
GitHub
github.com › GitbookIO › gitbook-cli › issues
Issues · GitbookIO/gitbook-cli
January 20, 2021 - GitbookIO / gitbook-cli Public · Notifications · You must be signed in to change notification settings · Fork 208 · Star 729 · Search Issues · is:issue state:open · is:issue state:open Search · LabelsMilestonesNew issue · Open · Closed · Status: Open.
Author: GitbookIO
🌐
npm
npmjs.com › package › @0y0 › gitbook-cli
@0y0/gitbook-cli - npm
February 7, 2022 - Security Update: Classic tokens have been revoked. Granular tokens are now limited to 90 days and require 2FA by default. Update your CI/CD workflows to avoid disruption. Learn more.× ... Use gitbook help command to print the usage.
      » npm install @0y0/gitbook-cli
    
Published: Feb 07, 2022
Version: 1.0.2
Author: Jason Chung
🌐
Thelinuxfaq
thelinuxfaq.com › npm › npm-packages › gitbook-cli
How to Install gitbook-cli NPM Packages on Ubuntu / Debian
July 14, 2017 - $ sudo npm install gitbook-cli $ sudo npm install -g gitbook-cli · If want to update the gitbook-cli package execute the command as below, ... Error: No Acceptable C Compiler Found in $PATH LinuxHow to Install and configure AWStats in CentOS / Fedora / RHELAWStats : Configure add Multiple Domains and Password ProtectHow to Start, Stop, Restart, Check Status IIS Service by Command LineHow to Install AVCONV on CentOS, RHEL 7 / 6 Could Not ...
🌐
npm
npmjs.com › package › gitbook
gitbook - npm
October 11, 2018 - Library and cmd utility to generate GitBooks. Latest version: 2.6.9, last published: 8 years ago. Start using gitbook in your project by running `npm i gitbook`. There are 34 other projects in the npm registry using gitbook.
      » npm install gitbook
    
Published: Oct 11, 2018
Version: 2.6.9
🌐
FreeBSD
freebsd-questions.freebsd.narkive.com › el2d3S1l › gitbook-on-freebsd
GitBook on FreeBSD?
October 18, 2015 - Post by Matthias Apitz Is it possible (has someone) to install GitBook locally on FreeBSD, to do the book rendering to HTML locally? I do not see any port for this. Thanks matthias There's no port for GitBook, but there is one for npm. https://www.freshports.org/www/npm/ Thanks. I have installed www/npm and run: $ npm install gitbook-cli -g npm ERR!
🌐
GitHub
github.com › GitbookIO › gitbook-cli › issues › 70
Fails to install dependencies of gitbook version · Issue #70 · GitbookIO/gitbook-cli
July 14, 2017 - I noticed that you don't version gitbook-cli but rather install gitbook api versions under $HOME/.gitbook/versions/<ver>. When I looked there, it didn't have a node_modules in it. I ran npm install and after that, the gitbook build . command worked.
Author: GitbookIO
🌐
GitHub
github.com › GitbookIO › gitbook-cli
GitHub - GitbookIO/gitbook-cli: GitBook's command line interface · GitHub
As the efforts of the GitBook team are focused on the GitBook.com platform, the CLI is no longer under active development. All content supported by the CLI are mostly supported by our GitBook.com / GitHub integration. Content hosted on the legacy.gitbook.com will continue working until further notice.
Starred by 730 users
Forked by 204 users
Languages: JavaScript
🌐
npm
npmjs.com › package › @feedzai › gitbook-cli
@feedzai/gitbook-cli - npm
gitbook-cli store GitBook's versions into ~/.gitbook, you can set the GITBOOK_DIR environment variable to use another directory. ... Run command gitbook build, gitbook serve (read GitBook documentation for details). ... By default, GitBook CLI will read the gitbook version to use from the book configuration, but you can force a specific version using --gitbook option:
      » npm install @feedzai/gitbook-cli
    
Published: Jun 30, 2020
Version: 2.4.0
🌐
npm
npm.io › home › gitbook-cli
gitbook-cli | npm.io
July 14, 2017 - gitbook-cli store GitBook's versions into ~/.gitbook, you can set the GITBOOK_DIR environment variable to use another directory. ... Run command gitbook build, gitbook serve (read GitBook documentation for details). ... By default, GitBook CLI will read the gitbook version to use from the book configuration, but you can force a specific version using --gitbook option:
Published: Feb 03, 2015
Version: 2.3.2
Author: FriendCode Inc.
🌐
npm
npm.io › home › @0y0/gitbook-cli
@0y0/gitbook-cli | npm.io
February 7, 2022 - Use gitbook help command to print the usage. ... @salesforce/cli389.7K/wk@mintlify/cli208.9K/wk@grafana/e2e-selectors128.7K/wkmintlify112.0K/wk@intlayer/cli22.8K/wk
Published: Feb 26, 2021
Version: 1.0.2
Author: Jason Chung