Couchbase SDK 4.4.x Native Build Error on Linux

After upgrading to Couchbase SDK version 4.4.3, our server started throwing the following error:

Error: Could not find native build for platform=linux, arch=x64, runtime=napi, nodeVersion=20.9.0, sslType=openssl3, libc=linux loaded from /opt/app-frontend/node_modules/couchbase.
    at resolvePrebuild (/opt/app-frontend/node_modules/couchbase/scripts/prebuilds.js  
at Object.loadPrebuild (/opt/app-frontend/node_modules/couchbase/scripts/prebuild  
at Object.<anonymous> (/opt/app-frontend/node_modules/couchbase/dist/binding.js:1  
at Module._compile (node:internal/modules/cjs/loader:1241:14)                     
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)               
at Module.load (node:internal/modules/cjs/loader:1091:32)                          
at Module._load (node:internal/modules/cjs/loader:938:12)                          
at Module.require (node:internal/modules/cjs/loader:1115:19)                       
at mod.require (/opt/app-frontend/node_modules/next/dist/server/require-hook.js:6  
at require (node:internal/modules/helpers:130:18)                                                                    

We attempted to downgrade to 4.4.1, but the same error persists. The environment details are:

  • OS: Linux
  • Node.js: 20.9.0
  • Couchbase SDK: 4.4.3 (also tried 4.4.1)
  • SSL: OpenSSL 3

It appears the SDK cannot locate a native build compatible with our platform.

Has anyone encountered this problem with Couchbase SDK 4.4.x and Node.js 20? Any advice or workarounds would be greatly appreciated.

We resolved the issue by following these steps:

  1. Deleted the node_modules and .next folders on the server.
  2. Downgraded the Couchbase SDK to version 4.4.1.
  3. Reinstalled dependencies and rebuilt the project from scratch.

After these steps, the server started running without any issues. If anyone else encounters this problem, a clean start with a compatible SDK version seems to resolve it.