Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node module version 127 vs 131 sqlite issue #337

Closed
markjkaem opened this issue Nov 15, 2024 · 6 comments
Closed

Node module version 127 vs 131 sqlite issue #337

markjkaem opened this issue Nov 15, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@markjkaem
Copy link

markjkaem commented Nov 15, 2024

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.
@markjkaem markjkaem added the bug Something isn't working label Nov 15, 2024
@odilitime
Copy link
Collaborator

See the QuickStart guide’s common issues
https://ai16z.github.io/eliza/docs/quickstart/#common-issues--solutions

@markjkaem
Copy link
Author

See the QuickStart guide’s common issues https://ai16z.github.io/eliza/docs/quickstart/#common-issues--solutions

I just did the things you mentioned, now I have this error:

Node.js v23.1.0
-@DESKTOP-OM5LKT9:/mnt/c/Users/-/sb/eliza$ pnpm add canvas --filter="@ai16z/eliza" --verbose
packages/core |  WARN  deprecated @types/[email protected]
 WARN  7 deprecated subdependencies found: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
packages/core | +7 -48 +-----
packages/core | Progress: resolved 816, reused 56, downloaded 0, added 7, done
packages/core/node_modules/pdfjs-dist/node_modules/canvas: Running install script...
node:internal/child_process:421
throw new ErrnoException(err, 'spawn');
^

Error: spawn E2BIG
at ChildProcess.spawn (node:internal/child_process:421:11)
at spawn (node:child_process:753:9)
at spawn (/home/m-rkt/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:84764:19)
at runCmd_ (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:104040:20)
at runCmd (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103980:9)
at runPackageLifecycle (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103947:7)
at Array. (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103164:13)
at LOOP (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103191:18)
at chain (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103198:9)
at lifecycle_ (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103921:7) {
errno: -7,
code: 'E2BIG',
syscall: 'spawn'
}

Node.js v23.1.0

@markjkaem
Copy link
Author

See the QuickStart guide’s common issues https://ai16z.github.io/eliza/docs/quickstart/#common-issues--solutions

I just did the things you mentioned, now I have this error:

Node.js v23.1.0
-@DESKTOP-OM5LKT9:/mnt/c/Users/-/sb/eliza$ pnpm add canvas --filter="@ai16z/eliza" --verbose
packages/core |  WARN  deprecated @types/[email protected]
 WARN  7 deprecated subdependencies found: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
packages/core | +7 -48 +-----
packages/core | Progress: resolved 816, reused 56, downloaded 0, added 7, done
packages/core/node_modules/pdfjs-dist/node_modules/canvas: Running install script...
node:internal/child_process:421
throw new ErrnoException(err, 'spawn');
^

Error: spawn E2BIG
at ChildProcess.spawn (node:internal/child_process:421:11)
at spawn (node:child_process:753:9)
at spawn (/home/m-rkt/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:84764:19)
at runCmd_ (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:104040:20)
at runCmd (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103980:9)
at runPackageLifecycle (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103947:7)
at Array. (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103164:13)
at LOOP (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103191:18)
at chain (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103198:9)
at lifecycle_ (/home/-/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:103921:7) {
errno: -7,
code: 'E2BIG',
syscall: 'spawn'
}

Node.js v23.1.0

I got it finally wokring now.

in
file:///mnt/c/Users/-/sb/eliza/packages/client-twitter/node_modules/agent-twitter-client/dist/node/esm/index.mjs

i changed this line :
import { Check } from '@sinclair/typebox/value';

to this:
import pkg from '@sinclair/typebox/value';
const { Check } = pkg;

@markjkaem
Copy link
Author

temp solution, not the best solution, but closed for now

@Segfaultd
Copy link

Same issue - Unable to pass through

@stoplion
Copy link

same issue not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants