当我运行我的博览会/玩笑项目时,我收到这些警告,我不知道为什么,在谷歌搜索时似乎没有出现。
console.warn
The "EXNativeModulesProxy" native module is not exported through NativeModules; verify that expo-modules-core's native code is linked properly
at Object.<anonymous> (node_modules/expo-modules-core/src/NativeModulesProxy.native.ts:54:11)
at Object.<anonymous> (node_modules/expo-modules-core/src/index.ts:4:1)
console.warn
No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?
at Object.<anonymous> (node_modules/expo-constants/src/Constants.ts:32:11)
at Object.<anonymous> (node_modules/expo-asset/src/PlatformUtils.ts:2:1)
我在测试(玩笑)中遇到了这个错误,我必须在玩笑配置中安装
jest-expo
并更改 preset
来模拟玩笑的博览会内容并修复此问题。
请参阅此处的详细信息:https://docs.expo.dev/guides/testing-with-jest/#installation
如果您在项目中使用任何 Expo 库,您需要的重要一点是 package.json 文件中的 expo 和 expo-core-modules 包。
例如就我而言:
"expo": "^48.0.0",
"expo-modules-core": "^1.2.3"
如果 package.json 不包含这些包,请安装它们:
npm install expo expo-modules-core
这可以帮助解决所有与世博会相关的警告和错误 在本机反应中(裸/安装-expo-modules):0.73.5 npm 我 [电子邮件受保护] 链接手动点击此链接==> https://docs.expo.dev/bare/installing-expo-modules/#using-expo-sdk-packages 安装后==>npm i expo-modules-core (版本: "expo-modules-core": "~1.11.10",) 如果您使用此包,则版本必须遵循=>expon-constant(version:15.4.5), 展览文件系统(版本:16.0.8), 世博字体(版本:11.10.3), expo-keep-awake(版本:12.8.2)等