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

Created on 31 Mar 2021  Â·  15Comments  Â·  Source: realm/realm-js

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
O-Community

Most helpful comment

@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.

All 15 comments

➤ Paolo Manna commented:

Reproduced with a regular Intel MacBook Pro

Cleaning npm cache and reinstalling all node_modules allows downgrading to 10.2.0

Code is available at https://github.com/mongodb/realm-practice

[^2021-03-31T09_54_09_721Z-debug.log] [^2021-03-31T10_13_52_971Z-debug.log] [^2021-03-31T10_50_13_434Z-debug.log]

@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.

Will downgrade and report back.

It works on M1 mac also.

I have the same error on: my M1

Output:
prebuild-install WARN install No prebuilt binaries found (target=15.13.0 runtime=node arch=arm64 libc= platform=darwin)
/bin/sh: cmake-js: command not found

@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.

@Tadejo9 I managed to make it work with the version node 15.13.0
I installed cmake with brew

Same problem using node v14.16.0

I have the same error on: my M1

@CodingByJerez

We don't produce binary packages for M1 yet.

Same problem using node v14.16.0

@gabrielrufino

Which CPU architecture and operating system?

Same error here when installing node dependencies in a React Native (v0.64.0) Project on mac (on Windows the same project works well). Node version: 14.15.0.

My mac is a Macbook pro 2015.

@BravenxX

I am not able to reproduce it using node 14.15.0, React Native 0.64.0 and Realm JavaScript 10.4.0 on my Macbook Pro (2019).

So you guys just aren't going to support those on M1? @kneth or is this on your roadmap for sometime in the next 12-18 months?

I followed the tut below to downgrade to node 14 and it worked on Mac M1 too.
https://medium.com/@georgeenathomas/3-step-process-to-downgrade-node-version-using-homebrew-bc0b0a72ae27

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 :smile:

Was this page helpful?
0 / 5 - 0 ratings