This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

Troublesheeting gyp/prebuild Installation Errors

5th November 2024 at 1:37pm

Installation may fail with errors related to gyp or prebuild. These errors are caused by missing dependencies or incorrect versions of dependencies.

Note that in most cases, these errors occur because of the use of the npm module better-sqlite3. This module is mostly written in C, and thus requires compilation for the target platform. MWS supports switchable database engines, and also supports the use of the node-sqlite3-wasm module which is written in JavaScript and does not require compilation and so may avoid these errors. See Database Engines for more details of how to switch between engines.

The following steps may help resolve errors involving gyp or prebuild:

  1. Ensure that you have the latest version of Node.js installed. You can download the latest version from the Node.js website.
  2. Update npm to the latest version by running the following command in your terminal:
    npm install -g npm@latest
  3. Clear the npm cache by running the following command in your terminal:
    npm cache clean --force
  4. Delete the node_modules folder in your TiddlyWiki directory by running the following command in your terminal:
    rm -rf node_modules
  5. Reinstall the dependencies by running the following command in your terminal:
    npm install
  6. If you continue to encounter errors, try running the following command in your terminal:
    npm rebuild
  7. If you are still experiencing issues, you may need to manually install the gyp and prebuild dependencies. You can do this by running the following commands in your terminal:
    npm install -g node-gyp
    npm install -g prebuild
  8. Once you have installed the dependencies, try reinstalling the TiddlyWiki dependencies by running the following command in your terminal:
    npm install