Metro遇到了一个错误:尝试解析模块时“ IDB-Keyval'从文件
尝试连接到以下文档的REECT本机中的数据库(Back4App): https://www.back4app.com/docs/react-native/parse-sdk/react-native-sdk 我获得了此错误消息:
尝试从文件/users/chenhana/Chenhana/testregistration/node_modules/parse/parse/parse/parse/rib/react-native/indexeddbstoragecontroller.js IDB-Keyval
>,成功找到了软件包/users/chenhana/testregistration/node_modules/idb-keyval/package.json
。但是,此软件包本身指定无法解决的main
模块字段(/users/chenhana/testregistration/node_modules/idb-keyval/dist/dist/compat.cjs
。的确。 ,这些文件都不存在:
- /users/chenhana/testregistration/node_modules/idb-keyval/dist/compat.cjs(comp.nativeM.Ios.ios.ts| native.native.ts| ts| ts| ts|.ios.ios.tsx|。 tsx | .tsx | ..ios.js | .native.js | .js | .js.ios.jsx | .native.jsx | .jsx | .jsx | .ios.json | .native.json | .json | .json)
- /users/users/chenhana/testregistration /node_modules/idb-keyval/dist/compat.cjs/index(.native |。本机| .js | .js | .ios.jsx | .native.jsx | .jsx | ..ios.json | .native.json | .json | .json)
尝试重置缓存,删除和重新安装NPM模块,然后与Doc(一起)(还安装了Parse JavaScript SDK),所以我不太确定为什么会出现任何帮助。
Trying to connect to a database (back4app) in React Native following this doc: https://www.back4app.com/docs/react-native/parse-sdk/react-native-sdk
I was given this error message:
While trying to resolve module idb-keyval
from file /Users/chenhana/TestRegistration/node_modules/parse/lib/react-native/IndexedDBStorageController.js
, the package /Users/chenhana/TestRegistration/node_modules/idb-keyval/package.json
was successfully found. However, this package itself specifies a main
module field that could not be resolved (/Users/chenhana/TestRegistration/node_modules/idb-keyval/dist/compat.cjs
. Indeed, none of these files exist:
- /Users/chenhana/TestRegistration/node_modules/idb-keyval/dist/compat.cjs(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
- /Users/chenhana/TestRegistration/node_modules/idb-keyval/dist/compat.cjs/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
Tried resetting cache, deleting and reinstalling npm modules, and followed along with the doc (also installed the Parse Javascript SDK) so I'm not too sure why this error keeps coming up. Any help will be appreciated, thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的
Metro.conf.js
文件中,放置以下代码:它可能会解决问题
In your
metro.conf.js
file, put the following code:It might solve the issue
为此,更改您的
Metro.config.js
:Change your
metro.config.js
for this: