Help for Realm® apps / Build errors

npm ci hangs on prebuild-install, or “Failed to download prebuild for Realm”

When you install realm, a script downloads a Node binary from static.realm.io. In CI this step can hang for hours, or fail with a 404 on Node 22.

Updated 9 November 2026.

The error

The install step that hangs (#7119):

npm info run realm@20.2.0 install node_modules/realm prebuild-install --runtime napi || echo 'Failed to download prebuild for Realm'

The 404 on Node 22 (#7068):

prebuild-install warn This package does not support N-API version undefined
prebuild-install http request GET https://static.realm.io/realm-js-prebuilds/20.1.0/realm-v20.1.0-napi-v127-linux-x64.tar.gz
prebuild-install http 404 https://static.realm.io/realm-js-prebuilds/20.1.0/realm-v20.1.0-napi-v127-linux-x64.tar.gz
prebuild-install warn install No prebuilt binaries found (target=undefined runtime=napi arch=x64 libc= platform=linux)

Later, when Node loads Realm (#6980):

Error: Cannot find module '/home/app/node_modules/realm/prebuilds/node/realm.node'.

When it happens

  • The hang: realm 20.2.0 in CI. In #7119, runners hit their 2 to 4 hour timeout, with 26 failed jobs between 20 March and 8 April 2026.
  • The 404: realm 20.1.0 and 20.2.0 on Node 22 with prebuild-install 7.1.2 (#7068, October 2025). Also reported with realm 12 on Node 22.14 and 23 (#6980).

Why

realm's install script runs prebuild-install --runtime napi. It downloads the Realm binary for Node from static.realm.io. That binary is used when Realm runs in Node, for example in Jest tests. The app on the phone does not use it.

The hang: the cause is not known, and #7119 has no reply. prebuild-install drops a download after 30 seconds without data (we read its source code), so the job may be stuck elsewhere in that step.

The 404: prebuild-install 7.1.2 cannot read the N-API version on recent Node, so it asks for a file named after Node's own ABI (napi-v127) that does not exist. prebuild-install 7.1.3 fixes this (prebuild-install #204, January 2025).

prebuild-install itself is no longer maintained: npm marks it as deprecated and its repository is archived.

Fix with afterdb

afterdb has no install script and does not use prebuild-install. The Node binaries for macOS (arm64 and x64), Linux (x64 and arm64) and Windows x64 are inside the package, so nothing is downloaded.

In package.json, point the two Realm packages to afterdb:

"realm": "npm:@pomwik/afterdb@20.3.0",
"@realm/react": "npm:@pomwik/afterdb-react@0.20.1"

Then reinstall, run pod install on iOS, and rebuild. For Expo dev builds, run npx expo prebuild --clean. Your code keeps import Realm from "realm". If you do not use @realm/react, the first line is enough.

afterdb is an independent open-source fork of the realm-js SDK v20 (Apache-2.0) that we maintain, for apps on realm 20.x without Device Sync. It is not an official Realm release. Code on GitHub, package on npm.

Tested: an offline install on Node 22, then open, write, query and an encrypted realm (macOS arm64 locally, Linux x64 in CI). realm-js's own Node integration tests give the same results as realm 20.2.0. There is no Node binary for Alpine Linux (musl) or Windows on arm64.

Without afterdb

  • For the 404 on Node 22: run npm update prebuild-install to get 7.1.3, without changing your Realm version. A user reports it works in #6980.
  • For the hang: cache ~/.npm/_prebuilds between CI runs. prebuild-install looks there before it downloads (you can see it in the log of #7068). We have not tested this.
  • If nothing in your project runs Realm in Node, npm ci --ignore-scripts skips the download. It also skips the install scripts of every other package. We have not tested this.

Need help? Send your versions and the full error for a free 15-minute check. We reply within 12 hours.