[BUG] Claude 0.2.91+ crashes with "ERROR Could not locate the bindings file."
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version:
0.2.91 (Claude Code) - Operating System: macOS 15.0, Apple M1 Max
- Terminal: iTerm2
I'm unable to use claude code now at all.
I've tried re-installing better-sqlite3 with bun and npm, and upgrading bun and reinstalling claude code, nothing helps.
after updating to the latest version 0.2.91, when i run anything, either claude headless or claude interactive, i get errors like this:
```(base) ~/great-work/lab/mcp-server-reddit [main] claude
╭───────────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│ │
│ /help for help │
│ │
│ cwd: /Users/greatwork/great-work/lab │
╰───────────────────────────────────────────────────────────╯
✔ Found 1 MCP server • /mcp
✔ Loaded project memory • /memory
※ Tip: Use git worktrees to run multiple Claude sessions in parallel. Learn more
hello
Error: Could not locate the bindings file. Tried:
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/build/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/build/Release/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/Debug/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/out/Release/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/Release/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/build/default/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/compiled/18.17.1/darwin/arm64/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
→ /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/lib/binding/node-v108-darwin-arm64/better_sqlite3.node
at bindings (/Users/greatwork/.bun/install/global/node_modules/bindings/bindings.js:126:9)
at new Database (/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/lib/database.js:48:64)
at file:///Users/greatwork/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:523:25211
at D (file:///Users/greatwork/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:496:12863)
at QS0 (file:///Users/greatwork/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:523:26277)
at $21 (file:///Users/greatwork/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:540:885)
at file:///Users/greatwork/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:1842:2020
at pZ (file:///Users/greatwork/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:93:21373)
at _X (file:///Users/greatwork/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:93:40823)
at DV (file:///Users/greatwork/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:93:34912) {
tries: [
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/build/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/build/Debug/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/build/Release/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/out/Debug/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/Debug/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/out/Release/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/Release/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/build/default/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/compiled/18.17.1/darwin/arm64/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node',
'/Users/greatwork/.bun/install/global/node_modules/better-sqlite3/lib/binding/node-v108-darwin-arm64/better_sqlite3.node'```
40 Comments
downgrading to 0.2.90 fixes the issue and claude code runs fine again
cd /Users/greatwork/.bun/install/global/node_modules/better-sqlite3/npm rebuildTemporary solves the trouble
@Alagunto thanks so much that did allow me to get around this issue and to keep using the new 0.2.91 version! appreciate you!
Works for pnpm too:
cd .local/share/pnpm/global/5/.pnpm/better-sqlite3@11.9.1/node_modules/better-sqlite3npm rebuildHi, sorry but we don't really support running claude code with bun right now, so this isn't part of test matrix.
I'll see what we can do to support this configuration.
Ok, I think we will be able to address this in our next version. Stay tuned.
I'm seeing this using vanilla Node and npm, no Bun involved.
Same here, no bun, just node
Ok thanks for these reports. The new version v0.2.93 should work with Bun. For folks having trouble with Node, can you please post an example stacktrace?
Sure! Here it goes:
https://gist.github.com/vemv/18b2430f05988e9697dcbc7675546298
@vemv thanks for the gist, it's helpful. I think we can recover from this. If you get a sec, can you please try:
Then try again to run claude code. If this works, we can try this step automatically
Hi @wolffiex !
Unfortunately rebuilding (which succeeded) didn't make a difference – same error.
@vemv that is bad news. Out of curiosity, does it fix things if you go to that directory and do
npm install better-sqlite3?Unfortunately, not either
But the command succeeds? What is your node version?
Yes, install and rebuild commands succeed.
I'm getting the same thing on multiple node versions and claude code versions (I still get the error downgrading to 0.2.90).
crash logs
Ok thanks for this info. I'm not too surprised the a non-LTS version like v23 would have problems but I am super surprised that this is causing problems on the mac with node v20.
Claude Code version 0.2.97 shipped this morning with some attempted recovery logic. I doubt it will fix the problems you are seeing, but if you get a chance to try it I'd love to hear what happens and/or get the stack trace if it crashes.
I actually started with v0.2.97 this morning and that's the first time I noticed it. Been at RSA all week so haven't actually launched it this week until today, fwiw.
@abraithwaite can you please share the stack trace from the crash?
It crashes on node as well. This is not specific to Bun.
It's in my original comment in the gist.
Edit: updated the gist with more context. After I get the crash, it just becomes unresponsive. Typing does not go into the input box.
This worked for me. Node 20
Thought it might be related to
fnm, but getting the same result with node installed from homebrew. Updated the gist again:https://gist.github.com/abraithwaite/97790b13c358637125ebe0ac3d7fd26c
Claude code doesn't work when installed with Volta as well. And funny enough it
volta uninstalldoesn't really uninstall... https://github.com/volta-cli/volta/issues/2041PS: It doesn't work with Node.js v22 and v23.
what works for me currently with bun is
essentially same issue. When using @anthropic-ai/claude-code CLI globally installed via npm under Node.js v20 (installed via nvm), the CLI fails due to better-sqlite3 native bindings not being located.
Environment:
OS: Ubuntu 24.04 (WSL2)
Node.js: v20.19.1 (installed via nvm)
NPM: 10.x
CLI: @anthropic-ai/claude-code latest (installed globally)
Terminal: bash/zsh
Error Output:
bash
Copy
Edit
Error: Could not locate the bindings file.
Tried:
→ .../better-sqlite3/build/better_sqlite3.node
→ .../lib/binding/node-v115-linux-x64/better_sqlite3.node
...
Stack trace points to:
Database (/node_modules/better-sqlite3/lib/database.js:48:64)
Steps to Reproduce:
nvm install 20 && nvm use 20
npm install -g @anthropic-ai/claude-code
Run any Claude command: claude /init or similar
Observe crash
Observations:
Issue is related to missing or miscompiled native bindings of better-sqlite3.
Downgrading to Node.js v18 resolves the problem.
Rebuilding better-sqlite3 manually with npm rebuild under Node 20 does not resolve.
Installing @anthropic-ai/claude-code locally within a project (instead of globally) has the same result under Node 20.
FWIW, it didn't work for me:
It may be worthwhile to look beyond Node or npm/bun/... versions. I tried digging into https://github.com/WiseLibs/better-sqlite3/issues but I couldn't immediately get a hint.
I found a workaround. I had been running
npm rebuildin thenode_modules/better-sqlite3dependency directory, however,npm rebuildappears to be a no-op if you don't have node-gyp installed.I installed
node-gypthen performed a rebuild and it was successful, showing the C compiler output and producing the expectedbetter-sqlite3.nodefile that it's looking for.IDK why
better-sqlite3doesn't error when node-gyp is not installed when attempting a rebuild, but this seemed to be it for me.Ok, I've been looking at this for the past few hours. One interesting thing I did not initially realize is that node-gyp is wrapper for a python package! I get much better results rebuilding the better-sqlite3 dependency when I have no venv active then when it is. I'm curious if anyone seeing issues can confirm.
Any particular reason why Claude-code doesn't use node:SQLite?
we are using drizzle for schema management. libsql is an option, but many things about better-sqlite3 (especially sync access) make more sense for our use case.
fix:
This doesn't work for Volta users.
I also had this error. And with 0.2.99. It would be tremendously @greatworkllc to make the title.
I'm also not using bun. I'm on linux. I don't even know what bun is. I'm getting the error with node installed from
n. I'm just using npm.As a work around, you can use
claude-podman. This works by running claude in a secure rootless container. It's a better idea all around and denies claude access to anything but the current working directory.I almost never have a virtualenv active.
This works......
basically the issue I had and I was using npm is the steps below: I was using node 20 and it wont work and also I installed claude globally and it didnt like that either.
While I applaud people trying to solve the problem. Try
claude-podman. It's a better idea all around. I'm happy to help out with it. It'll stop claude from reading files not in your $PWD, it'll also stop claude from executing utilities not in the container.Ok thanks for all the input and debugging.
v0.2.100 is out
This version handles the failure to open the database storage more gracefully. The trade-off is that the continue and resume commands are disabled and your conversations won't be saved if the database dependency doesn't work.
For folks using npm and node, the simplest workaround should be
npm install -g better-sqlite3For now, claude doesn't make noise if it can't open the db, but you'll know it's not working if you get an error message when you try
claude -rThis situation is temporary. We are working on better packaging that will make this dependency unnecessary. In the meantime, thanks for bearing with us.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.