I am currently trying to install the sqlite3 dependency for my React Native app. However, I am running into the following error message:
error: Error: Unable to resolve module path from C:\Users\...\Documents\Projects\sample\node_modules\sqlite3\lib\sqlite3.js: path could not be found within the project or in these directories:
node_modules
> 1 | const path = require('path');
| ^
2 | const sqlite3 = require('./sqlite3-binding.js');
3 | const EventEmitter = require('events').EventEmitter;
4 | module.exports = exports = sqlite3;
Does anyone know what the case of this is? If so, are there any other recommendations for SQL libraries for React Native? Thanks.
CodePudding user response:
The sqlite dependency you are trying to use relies on node. Your React Native environment likely doesn't include node.
Try a solution designed for React Native, like react-native-sqlite-storage