Realm-js: Support Node 10. WAS: Realm fails to install via yarn or npm, with the error Failed to execute 'node-gyp build --fallback-to-build --module=[hidden_path]/node_modules/realm/compiled/node-v64_darwin_x64/realm.node --

Created on 24 May 2018  路  27Comments  路  Source: realm/realm-js

Goals

Use yarn or npm to install realm

Expected Results

Installs correctly

Actual Results

404 on https://static.realm.io/node-pre-gyp/2.3.2/realm-v2.3.2-node-v64-darwin-x64.tar.gz which causes install to fail

Version of Realm and Tooling

  • Realm JS SDK Version: 2.3.2
  • Node or React Native: React Native
  • Client OS & Version: Mac 10.13.4
  • Which debugger for React Native: None
O-Community P-1-Required T-Enhancement

Most helpful comment

@tigranbalayan @jaltin @rogerkerse @edmofro @esutton @mnlbox @Paradox-AT @renalpraba

I have released v2.19.0-rc.5 which adds support for node 10. The plan is to do a v2.19.0 release later this week.

All 27 comments

I am also having the same issue while installing the module.

We don't support node version 10 yet.

Thanks, have downgraded to node 9.8.0 for now.

We have done the initial work on it, but some of the node-js' C++ APIs have changed, and NaN has been updated. We plan to return to it soon.

I'm also have same issue and switch from node v.10.1.0 to v9.0.0 and it's working now.

Guys when you plan to update to v10+?

Once NaN is stabilized (API wise), we plan to return to it. I hope to include it in a release in June.

I have investigated it a bit more. It is not Nan nor LZMA (at least 3.0.8 supports - decompress-tarxz depends on it) . It boils to that ursa hasn't released after https://github.com/JoshKaufman/ursa/pull/169 has been merged (see also https://www.npmjs.com/package/ursa).

@edmofro How do you downgrade node to 9.8.0?

I cannot figure out how to downgrade my build machine to:

I tried:
brew uninstall yarn brew uninstall --force node brew install [email protected] Error: No available formula with the name "[email protected]"

Never mind. I ended up using npm instead of homebrew:
brew install npm npm install -g [email protected] brew install yarn

I am on node 10 right now and I still cannot install Realm. Has someone dealt with this issue?

The issue is still open which indicates that it has not been resolved yet. Once we release a node 10 compatible version, we'll report here and close the issue.

try
npm install -g [email protected]
npm i --save realm

the issue is actual also with:
node v8.11.2
npm 5.6.0

on CentOS

I also just stumbled on this problem when trying to add realm to a react-native app and having node 10 installed on my machine. Downgrading to 9.11.2 solved it for me.

It took me quite a while to figure out what was going wrong and fix this. It would make sense to mention that node 10 is not supported in the official documents at https://realm.io/docs/javascript/latest/ so others don't run into the same problem.

@tigranbalayan @jaltin @rogerkerse @edmofro @esutton @mnlbox @Paradox-AT @renalpraba

I have released v2.19.0-rc.5 which adds support for node 10. The plan is to do a v2.19.0 release later this week.

On node 11 having same issue

@fisherwise We haven't added support for node 11 yet. Please create an issue for it.

on node 11 i can't install realm,what should i do?use low node version?

on node 10 i can use it.

Node 10.13 successful w/ [email protected].

9.8.0

how di you downgraded node in macbook ?

Try n or nvm.

if you use node version 11 try this

  1. install nvmw

    • npm install -g nvmw

    • install node version 10 ex : nvmw install v10.12.0

    • use node version 10 using this command : nvmw use v10.12.0

  2. edit your realm version in package.json to v2.19.0-rc.5
  3. reinstall in cmd

I personally prefer nodenv. It works the exact same way as rbenv, if you're familiar with that. _But_, realm wants either n or nvm, which I think isn't fair. It should just want and expect _a_ version of node. Not any, or worse a specific, node package manager.

You guys could also try NVM. It is pretty simple, and allows you to install and use multiple versions of node.
https://github.com/nvm-sh/nvm

It means that the version of Realm you are requesting for is not yet supported either due to your nodejs version or the architecture of your machine. However you can include additional options to your command to install available ones.

From DOCs as found here: node_modules/realm/node_modules/node-pre-gyp/lib/util/versioning.js, you can add target_arch to suite the system configuration of your machine.

npm i realm --save --target_arch=x64

Was this page helpful?
0 / 5 - 0 ratings