MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Install realm 5.0.3 on react native 0.62.0

i want install realm 5.0.3 on react native 0.62.0
but i catch this error :
Failed to compile

D:/code/react/t8/node_modules/node-pre-gyp/lib/info.jsModule not found: Can't resolve 'aws-sdk' in 'D:\code\react\t8\node_modules\node-pre-gyp\lib'

This error occurred during the build time and cannot be dismissed.

what is problem?

Hi,

The aws-sdk package is not a dependency of the Realm React Native SDK and I cannot reproduce this error trying to follow the normal Realm React Native installation instructions. I suspect this dependency is related to another package you are trying to install (or have specified in your application dependencies).

Can you provide more information on the steps to reproduce this issue:

  • What specific command line did you run to get this error message?
  • What version of Node.js are you using?
  • Are you following a specific blog post or tutorial? If so, I’d recommend checking the publication date for your tutorial and consider starting with the official documentation first.

Regards,
Stennie

hi

thanks for your attention

after a project was generated by “expo init”, added realm.then id add realm code based on realm site. after more try i find problem is related to this package:
node-pre-gyp

i am using:
node 13.13

how can i solve it?

Hi,

Please provide the actual commands used and more information (output or error messages) to help reproduce the issue.

For example:

  • what options did you use with expo init?
  • did you have all dependencies successfully installed before adding Realm?
  • what specific steps did you take to “add Realm code”?

Regards,
Stennie

  • what options did you use with expo init ?
    nothing only:
    expo init

  • did you have all dependencies successfully installed before adding Realm?
    yes: npm install run

  • what specific steps did you take to “add Realm code”?
    npm install realm

Hi,

I still can’t reproduce the error with the information provided so far, but since aws-sdk is a dev dependency for node-pre-gyp you could try: npm install realm --save --prod.

expo init provides several application template options to select from, eg:

? Choose a template: (Use arrow keys)
  ----- Managed workflow -----
❯ blank                 a minimal app as clean as an empty canvas
  blank (TypeScript)    same as blank but with TypeScript configuration
  tabs                  several example screens and tabs using react-navigation
  ----- Bare workflow -----
  minimal               bare and minimal, just the essentials to get you started
  minimal (TypeScript)  same as minimal but with TypeScript configuration

Which of these template options did you choose?

Note that this command line will install the run package from npm. You probably just wanted npm install.

Regards,
Stennie

Hi @11117,

I just realised there is an important note below the installation info in the Realm React Native documentation:

Please note that Expo does not support Realm, create-react-native-app will not work.

Even if you can get past your initial install issues, apparently Expo currently only packages JavaScript code so deploying an app with compiled dependencies (like Realm) is not supported.

You can upvote & watch the Expo does not support Realm feature request for updates.

Regards,
Stennie