-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Test does not work with Node v22 #61
Comments
By manually rebuilding better-sqlite3, I was able to run vitest on Node v22 but I think this shouldn't be done manually. Rebuild command log$ cd /tmp/tsky/node_modules/.pnpm/[email protected]/ $ pnpm run build-release
|
related issue: WiseLibs/better-sqlite3#146 |
It looks like
|
Here's what I investigated so far. In a happy path,
When we run vitest, this binary is automatically loaded when better-sqlite3 is used. |
When we run vitest, we observed three similar errors but it seems all three errors have different causes. 1. compiled against a different Node.js version⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: The module '/tmp/tsky/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 115. This version of Node.js requires
NODE_MODULE_VERSION 127. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`). I encountered this when I run This can be solved by installing the newer binary. 2. Could not locate the binding file.> pnpm --filter @tsky/client test
> @tsky/[email protected] test /home/shuuji3/dev/tsky/packages/client
> vitest
DEV v3.0.5 /home/shuuji3/dev/tsky/packages/client
No test files found. You can change the file name pattern by pressing "p"
include: **/*.{test,spec}.?(c|m)[jt]s?(x)
exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: Could not locate the bindings file. Tried:
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/Release/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/Debug/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/out/Release/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/Release/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/default/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/compiled/22.14.0/linux/x64/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
→ /home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/lib/binding/node-v127-linux-x64/better_sqlite3.node
❯ bindings ../../node_modules/.pnpm/[email protected]/node_modules/bindings/bindings.js:126:9
❯ new Database ../../node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/lib/database.js:48:64
❯ Database.sqlite ../../node_modules/.pnpm/@[email protected]/node_modules/@atproto/pds/dist/db/db.js:37:26
❯ getDb ../../node_modules/.pnpm/@[email protected]/node_modules/@atproto/pds/dist/did-cache/db/index.js:28:26
❯ new DidSqliteCache ../../node_modules/.pnpm/@[email protected]/node_modules/@atproto/pds/dist/did-cache/index.js:37:34
❯ AppContext.fromConfig ../../node_modules/.pnpm/@[email protected]/node_modules/@atproto/pds/dist/context.js:247:26
❯ PDS.create ../../node_modules/.pnpm/@[email protected]/node_modules/@atproto/pds/dist/index.js:114:48
❯ TestPdsServer.create ../internal/dev-env/dist/pds.js:66:56
64| }
65| get ctx() {
66| return this.server.ctx;
| ^
67| }
68| adminAuth() {
❯ TestNetwork.create ../internal/dev-env/dist/network.js:16:21
❯ Object.setup globalSetup.ts:7:13
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { tries: [ '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/Debug/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/Release/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/out/Debug/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/Debug/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/out/Release/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/Release/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/build/default/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/compiled/22.14.0/linux/x64/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node', '/home/shuuji3/dev/tsky/node_modules/.pnpm/[email protected]/node_modules/better-sqlite3/lib/binding/node-v127-linux-x64/better_sqlite3.node' ] } This error occurs when there is no binary file at the expected directory: I guess this could happen when 1) pnpm/Node fails to run the We saw this on Aditya's macOS machine with Node v22. 3.
|
The current vitest works only with Node v20 (previous LTS), but not with v22 (current LTS).
There seem to be two issues:
Node v20
Node v22
better-sqlite3 error
The text was updated successfully, but these errors were encountered: