realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Missing prebuilds/node when using node v23

Open c100k opened this issue 11 months ago • 5 comments

How frequently does the bug occur?

Always

Description

I've just upgraded my codebase to node v23. After running yarn install and yarn start, my Node app using Realm does not start anymore saying Cannot find module '/home/app/node_modules/realm/prebuilds/node/realm.node'.

And indeed, ls -la node_modules/realm/prebuilds shows only android and apple.

When I switch back to node v22 and run yarn install and yarn start again, it works as node_modules/realm/prebuilds contains android, apple and node.

Stacktrace & log output

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

Can you reproduce the bug?

Always

Reproduction Steps

Assuming you have a project with package.json having [email protected] as a dependency.

nvm use 22
rm -rf node_modules && yarn install
ls -la node_modules/realm/prebuilds # OK => contains android, apple and node

nvm use 23
rm -rf node_modules && yarn install
ls -la node_modules/realm/prebuilds # KO => contains android, apple but not node

Version

12.14.1

What services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

macOS Sequoia

Build environment

No response

Cocoapods version

No response

c100k avatar Mar 09 '25 18:03 c100k

FWIW I am on [email protected] and and [email protected] and do not have this issue.

brianomchugh avatar Mar 10 '25 15:03 brianomchugh

Same issue here, but your solution has no success (Node:v22.14.0, Realm: 12.11.0)

nvm use 22 rm -rf node_modules && yarn install ls -la node_modules/realm/prebuilds # OK => contains android, apple and (NOT NODE)

Acetyld avatar Mar 11 '25 13:03 Acetyld

Is there any update on this?

Acetyld avatar Mar 20 '25 13:03 Acetyld

Is there any update on this?

None. If you're a paying customer hitting this issue, please ensure you reach out via the official support channels.

Any help from the community investigating, debugging and fixing this would be highly appreaciated.

kraenhansen avatar Mar 21 '25 08:03 kraenhansen

We have the same issue after upgrading node from 22.13.1 to 22.14.0. Updating the prebuild-install dependency of Realm to version 7.1.3 (see related issue) fixed the problem for us. This can be done by running npm update prebuild-install and does not require an update of Realm.

matthesjh avatar Mar 24 '25 13:03 matthesjh