Default search plugin compatibility with GitBook CLI 2.0.0
The default search plugin is bundled with GitBook CLI 2.0.0 and installed automatically via gitbook install. It relies on Lunr.js and injects a client‑side search widget into the generated HTML, requiring no server‑side changes. Under typical conditions—Node.js 8 or higher and no explicit disable in book.json—the plugin remains fully functional.
Likely explanation
GitBook CLI 2.0.0’s minimum supported runtime is Node.js 8. The default search plugin was designed for the CLI 2.x series and continues to be included in the default plugin set. Because the search widget operates entirely in the browser, there are no inherent build‑time incompatibilities with CLI 2.0.0 itself, provided the Node runtime meets the minimum version.
- Run
gitbook install and confirm that node_modules/@gitbook/plugin-search appears.
- Run
gitbook build and open the produced index.html in a browser.
- Enter a keyword present in your book’s content and verify that search results populate.
- Open the browser developer console and look for errors such as
ReferenceError: lunr or failed resource loads.
gitbook install
Assumptions and uncertainty
Compatibility assumes Node.js >= 8, which is the minimum runtime GitBook CLI 2.0.0 requires. If your Node version is lower, the plugin may fail to install or build. Additionally, if book.json explicitly sets "search": false or overrides the plugin configuration, the default widget will not render. The plugin is no longer actively maintained since the GitBook 3.x transition, but it continues to work with CLI 2.0.0 under the conditions noted above.
Missing diagnostic detail: If you can confirm your current Node.js version, I can refine whether the plugin will install without issues. Otherwise, the steps above will reveal compatibility in your environment.