Brand new realm 2.1.1 install, build fails (old lzma-native dependency)
See original GitHub issueGoals
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:
- Created 6 years ago
- Reactions:18
- Comments:18 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
I solved it by NVM
Please check the node version installed in error message, such as this one: ‘v7.10.0 is already installed’
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