Ad

React-native-db-models Uncaught Error

- 1 answer

I am wanting to use the react-native-db-models for local-db on my React Native iOS app.

I've npm installed react-native-db-models from here and have followed the instructions on the page of creating a db.js file that contains the example given on both Github page and NPM page. Then in the file that needs access to the DB, I've created vars for both DB and DBEvents, following the docs accordingly.

When running the project in Xcode it results in a Build Fail.

uncaught error Error: UnableToResolveError: Unable to resolve module 
util from /Users/tmhn/Project/DoppioHealth/node_modules/react-native-db-models/node_modules/promise-es6/lib/utils.js: 

Invalid directory /Users/node_modules/util

I have also npm installed the two dependencies listed on the npm page: es6-promises and eventemitter3, to no avail.

Note: DoppioHealth is the project name

Ad

Answer

Investigated the Github Issues and found this solved the issue

Ad
source: stackoverflow.com
Ad