Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tadejo9 opened this issue Mar 31, 2021 · 20 comments · Fixed by #3679
Closed

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

Tadejo9 opened this issue Mar 31, 2021 · 20 comments · Fixed by #3679
Assignees

Comments

@Tadejo9
Copy link

Tadejo9 commented Mar 31, 2021

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
@sync-by-unito
Copy link

sync-by-unito bot commented Mar 31, 2021

➤ 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]

@kneth
Copy link
Member

kneth commented Mar 31, 2021

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

@Tadejo9
Copy link
Author

Tadejo9 commented Mar 31, 2021

Will downgrade and report back.

@Tadejo9
Copy link
Author

Tadejo9 commented Mar 31, 2021

It works on M1 mac also.

@kneth kneth mentioned this issue Mar 31, 2021
1 task
@CodingByJerez
Copy link

CodingByJerez commented Apr 2, 2021

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

@Tadejo9
Copy link
Author

Tadejo9 commented Apr 2, 2021

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

@CodingByJerez
Copy link

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

@gabrielrufino
Copy link

Same problem using node v14.16.0

@kneth
Copy link
Member

kneth commented Apr 6, 2021

I have the same error on: my M1

@CodingByJerez

We don't produce binary packages for M1 yet.

@kneth
Copy link
Member

kneth commented Apr 6, 2021

Same problem using node v14.16.0

@gabrielrufino

Which CPU architecture and operating system?

@ghost
Copy link

ghost commented Apr 23, 2021

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.

@kneth
Copy link
Member

kneth commented Apr 26, 2021

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

@flikQ
Copy link

flikQ commented Apr 29, 2021

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?

@lmai5
Copy link

lmai5 commented May 3, 2021

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

@kneth
Copy link
Member

kneth commented May 4, 2021

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 😄

@tomas-hartman
Copy link

What's the current status? I still cannot install realm on M1 Pro, even though I tried various node versions (14 and 16) and other above-mentioned tips (install cmake via brew) and different realm versions (10.1.2, 10.2.0 and 10.19.x).

@kraenhansen
Copy link
Member

kraenhansen commented Jun 4, 2022

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

@angelos3lex
Copy link

angelos3lex commented Jan 9, 2023

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)

@dinesh-brilworks
Copy link

Facing the same issue,

[stderr] npm ERR! code 127
[stderr] npm ERR! path /home/expo/workingdir/build/node_modules/realm
[stderr] npm ERR! command failed
[stderr] npm ERR! command sh -c -- prebuild-install --tag-prefix= -r napi || cmake-js build
[stderr] npm ERR! prebuild-install warn install certificate has expired
[stderr] npm ERR! sh: 1: cmake-js: not found

@husenbyjus
Copy link

husenbyjus commented Jan 10, 2023

try clearing yarn cache and change network, some proxy might be blocking it

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.