android 错误:尝试解析模块“react-native-fbads”时

xiozqbni  于 2023-02-27  发布在  Android
关注(0)|答案(1)|浏览(124)

我在我的react原生应用程序中插入Facebook广告。我已经安装了***react-native-fbsdk-next***并进行了设置。我对此没有任何问题。
现在我已经按照文档安装了***react-native-fbads***,但是我得到了这个错误:

Error: While trying to resolve module `react-native-fbads` from file `Component File`, the package `PATH/node_modules/react-native-fbads/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`PATH/node_modules/react-native-fbads/dist/lib/index.js`. Indeed, none of these files exist:

有人能帮我解决这个问题吗?我试过在metroidonconfigidojs中添加这个

resolver: {
    sourceExts: ['jsx', 'js', 'ts', 'tsx', 'cjs'],
},
8xiog9wr

8xiog9wr1#

转到nodemodules/react原生fbads的package.json文件,然后打包. Json,并将主值更改为src/index.js或index.ts

相关问题