Closed
Description
Issue Summary
I am encountering an error when trying to run the project after installing dependencies. The error seems related to the better-sqlite3
module not being compatible with my version of Node.js. The error message suggests a mismatch between the Node.js version and the compiled module version.
Error Log
(node:37509) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
DirectClientInterface start DirectClient constructor
Error starting agent for character Eliza:
Error: The module '/mnt/c/Users/--/sb/eliza/node_modules/better-sqlite3/build/Release/better_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 127.
This version of Node.js requires NODE_MODULE_VERSION 131.
Please try re-compiling or re-installing the module (for instance, using pnpm rebuild or pnpm install).
at Object..node (node:internal/modules/cjs/loader:1735:18)
at Module.load (node:internal/modules/cjs/loader:1315:32)
at Function._load (node:internal/modules/cjs/loader:1125:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:216:24)
at Module.require (node:internal/modules/cjs/loader:1337:12)
at require (node:internal/modules/helpers:139:16)
at bindings (/mnt/c/Users/--/sb/eliza/node_modules/bindings/bindings.js:112:48)
at new Database (/mnt/c/Users/--/sb/eliza/node_modules/better-sqlite3/lib/database.js:48:64)
at initializeDatabase (file:///mnt/c/Users/--/sb/eliza/packages/agent/src/index.ts:137:42)
{ code: 'ERR_DLOPEN_FAILED' }
Error starting agents:
Error: The module '/mnt/c/Users/--/sb/eliza/node_modules/better-sqlite3/build/Release/better_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 127.
This version of Node.js requires NODE_MODULE_VERSION 131.
Please try re-compiling or re-installing the module (for instance, using pnpm rebuild or pnpm install).
at Object..node (node:internal/modules/cjs/loader:1735:18)
at Module.load (node:internal/modules/cjs/loader:1315:32)
at Function._load (node:internal/modules/cjs/loader:1125:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:216:24)
at Module.require (node:internal/modules/cjs/loader:1337:12)
at require (node:internal/modules/helpers:139:16)
at bindings (/mnt/c/Users/--/sb/eliza/node_modules/bindings/bindings.js:112:48)
at new Database (/mnt/c/Users/--/sb/eliza/node_modules/better-sqlite3/lib/database.js:48:64)
at initializeDatabase (file:///mnt/c/Users/--/sb/eliza/packages/agent/src/index.ts:137:42)
{ code: 'ERR_DLOPEN_FAILED' }
Chat started. Type 'exit' to quit.
You: Server running at http://localhost:3000/
Steps to Reproduce
Clone the repository:
git clone <repo-url>
Install dependencies:
pnpm install
Run the project:
pnpm start or node <entry-file>
Observe the error in the terminal.
System Information
Node.js version: v18.17.1 (example; replace with your actual version)
Linux Distribution: Ubuntu 20.04 (example; replace with your actual distribution)
Kernel version: 5.4.0-80-generic (example; replace with your actual kernel version)
pnpm version: 9.6.1 (example; replace with your actual pnpm version)
Possible Causes & Solution Suggestions
I suspect that there is a mismatch between the version of Node.js and the better-sqlite3 binary. The error message indicates that the better-sqlite3 module was compiled with NODE_MODULE_VERSION 127, while my current Node.js version requires NODE_MODULE_VERSION 131.
Possible solutions:
Try rebuilding the module:
pnpm rebuild better-sqlite3
Reinstall the better-sqlite3 module:
pnpm uninstall better-sqlite3 && pnpm install better-sqlite3
Ensure the version of Node.js being used matches the version the module was compiled for.
Additional Information
I am using Node Version Manager (nvm) to manage different Node.js versions.
The project is running in a Linux environment, but my system is dual-booted with Windows. I am using a WSL (Windows Subsystem for Linux) environment.
Expected Behavior
I expect the server to start successfully, but instead, the error prevents the agent from starting.
Activity