realm-js: npm install crashing with sh: cmake-js: command not found

Goals

Trying to install node modules for project.

Expected Results

Installed node modules.

Actual Results

I get the following error.

npm ERR! code 127
npm ERR! path /Users/.../node_modules/realm
npm ERR! command failed
npm ERR! command sh -c prebuild-install || cmake-js rebuild
npm ERR! sh: cmake-js: command not found

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/.../.npm/_logs/2021-03-31T09_48_36_996Z-debug.log

Here I provide log file referenced above.

Steps to Reproduce

Add realm to dependencies in package.json and configure it by the docs.

Version of Realm and Tooling

  • Realm JS SDK Version: 10.2.0(used to work couple of days ago) && 10.3.0
  • Node or React Native: node 15.12.0, RN: 0.63.2
  • Client OS & Version: MacOS 11.2.3, M1 macbook pro
  • Which debugger for React Native: None
  • XCode version: 12.4

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 20 (6 by maintainers)

Most upvoted comments

@CodingByJerez It seems you are using node 15.13.0

I suggest you follow this article and downgrade to node 14.x as @kneth suggested above.

I experience this atm in github actions using ubuntu-latest, and node version 14. (its probably same problem due to expired certificate as mentioned above)

@tomas-hartman we’re currently experiencing an issue with an expired certificate, which has the same symptoms as this issue. Please try again tomorrow and everything should be fine 🙏

Same problem using node v14.16.0

So you guys just aren’t going to support those on M1?

M1 is on our radar, and we hope to have progress soon. One challenge is to support both MacOS and iOS with the same XCode project (see also Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64). We have been waiting for the (M1) dust to settle 😄

@Tadejo9 Thank you for reporting.

I can reproduce the error using node v15.12.0 while I can install node v14.15.1 without any issues.

We need to investigate why our usage of prebuild-install fails with node v15.x.

As a workaround, I suggest that you downgrade to node v14.x.