Skip to content

Instantly share code, notes, and snippets.

@JSouthGB
Created November 11, 2025 19:20
Show Gist options
  • Select an option

  • Save JSouthGB/5a75b2683f3b8cf3bad4f26da5ad2e17 to your computer and use it in GitHub Desktop.

Select an option

Save JSouthGB/5a75b2683f3b8cf3bad4f26da5ad2e17 to your computer and use it in GitHub Desktop.
compiled against a different Node.js version

When receiving an error such as below:

Error: The module '/<project_path>/<project_name>/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 137. This version of Node.js requires
NODE_MODULE_VERSION 141. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

My issue is that I used my OS's package manager (pacman) to install nodejs and pnpm. So even though I used nvm to set the correct node version, 24.11, Webstorm was using /usr/bin/node (v25.xx).

Three options to fix

  1. Update Webstorm to use the intended node interpreter - ~/.config/nvm/versions/node/v24.11.0/bin/node

  2. Use the package manager to remove nodejs. Webstorm will then default to using nvm's set version

  3. Use the package manager to remove pnpm and install pnpm via npm - npm install -g pnpm

Ultimately, 2 + 3 gives gives a single source of truth by having nvm manage everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment