Couchbase with Nextjs - Could not find native build for platform=linux

I’ve tried everything including a 20-bullseye-slim Docker image and just can’t get it. Before attempting Docker, I was just running on a Debian 12 VM. I’ve tried multiple node versions, obviously starting with --lts. I tried to install with npm install couchbase

This is the error I’m getting: ⨯ Error: Could not find native build for platform=linux, arch=x64, runtime=napi, nodeVersion=20.19.2, sslType=openssl3, libc=linux loaded from /app/[project]/node_modules/couchbase/dist.

I’ve read some other posts, but the proposed solutions aren’t working. Any help here is appreciated!

Just to help others out, I’ve played with the official nextjs/couchbase demo (git clone) and was puzzled that it was working while mine had issues with the native build. I came to realize that they’re on v4.2.4. I haven’t trialed other versions, but I did nvm install 20 and set the Couchbase version in package.json to 4.2.4, and have had success. I will need to do some digging to determine if there’s any security ramifications for doing this, but for those of you trying to get things off the ground, I hope this helps.

Edit: npm audit recommended updating to 4.4.6, which suddenly seems to work fine. I had specifically tried “nvm install 20” and 4.4.6 before without luck. I’m not sure what exactly changed but starting with 4.2.4 and later switching to 4.4.6 worked like magic.

Hi @slothman – Glad to hear you have something working. I created JSCBC-1352 to log some pathfinding that I have been meaning to work through. Unfortunately other priorities make finding cycles to spend on issues as these difficult.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.