question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Brand new realm 2.1.1 install, build fails (old lzma-native dependency)

See original GitHub issue

Goals

What are you trying to achieve?

Install realm in a react native project

What did you expect to happen?

Build successful

What happened instead?

Build fails. Unmet dependencies with lzma-native.

It seems that when extracting realm-sync-cocoa it looks for a lzma-native module that doesn’t exist (binding-v3.0.4-node-v51-darwin-x64 instead of binding-v3.0.4-node-v59-darwin-x64).

Steps to Reproduce

Create a brand new react native project, install realm-js and build:

react-native init app
cd app
npm install realm --save
react-native link

Build fails.

Code Sample

Xcode build output:

v7.10.0 is already installed.
Now using node v7.10.0 (npm v4.2.0)
Resolved requirements: { SYNC_SERVER_FOLDER: 'sync',
  SYNC_ARCHIVE: 'realm-sync-cocoa-2.1.10.tar.xz',
  SYNC_ARCHIVE_ROOT: 'core' }
Target directory has a differing lockfile, overwriting.
Extracting realm-sync-cocoa-2.1.10.tar.xz => /Users/ruben/dev/test/Wayne/node_modules/realm/vendor/realm-ios
{ Error: Cannot find module '/Users/ruben/dev/test/Wayne/node_modules/lzma-native/binding-v3.0.4-node-v51-darwin-x64/lzma_native.node'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at /Users/ruben/dev/test/Wayne/node_modules/lzma-native/index.js:13:14
    at Object.<anonymous> (/Users/ruben/dev/test/Wayne/node_modules/lzma-native/index.js:595:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12) code: 'MODULE_NOT_FOUND' }
Command /bin/sh failed with exit code 1

Available binding folders for lzma-native:

binding-v3.0.1-node-v58-linux-x64
binding-v3.0.1-node-v59-linux-x64
binding-v3.0.3-node-v59-linux-x64
binding-v3.0.4-node-v59-darwin-x64

Version of Realm and Tooling

  • react: 16.0.0
  • react-native 0.51.0
  • realm 2.1.1
  • lzma-native@3.0.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:18
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
knethcommented, Jan 3, 2018

As @esutton points out, a mismatch of node versions can cause many problems. We are working on getting rid of our LZMA-native dependency, but we will appreciate any help on the build side.

2reactions
vincentsongcommented, Jan 8, 2018

I solved it by NVM

  1. Please check the node version installed in error message, such as this one: ‘v7.10.0 is already installed’

  2. then run below commands nvm use v7.10.0 npm i lzma-native -D

you can see that the correct version of lzma_native.node installed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Brand new realm 2.1.1 install, build fails (old lzma-native ...
Brand new realm 2.1.1 install, build fails (old lzma-native dependency) · What are you trying to achieve? Install realm in a react native...
Read more >
React native old project build failed - Stack Overflow
I am working in a old react native project. I am getting errors while running this app. How I can solve these errors....
Read more >
lzma-native - npm
Provides bindings to the native liblzma library (.xz file format, among others). Latest version: 8.0.6, last published: a year ago.
Read more >
lzma-native | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found