我目前正在尝试为我的安装sqlite3依赖项。但是,我遇到了以下错误消息:
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;有人知道这是什么情况吗?如果是这样的话,是否还有其他关于React本机的SQL库的建议?谢谢。
发布于 2022-10-23 10:33:14
您试图使用的sqlite依赖项依赖于节点。您的React本机环境可能不包括节点。
尝试一种为反应本机而设计的解决方案,如react-native-sqlite-storage
https://stackoverflow.com/questions/74161343
复制相似问题