【问题标题】:Error: While trying to resolve module `react-native-fbads`错误:尝试解析模块“react-native-fbads”时
【发布时间】:2023-02-25 04:16:38
【问题描述】:

我在我的 React 本机应用程序中插入 Facebook 广告。我已经安装react-native-fbsdk-next并设置它。我对此没有任何问题。

现在我已经安装了反应本机 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:

谁能帮我解决这个问题?我试过在 metro.config.js 中添加这个

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

【问题讨论】:

    标签: android reactjs react-native


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2022-01-17
      • 1970-01-01
      • 2019-04-15
      • 2021-02-05
      • 2022-10-21
      • 1970-01-01
      • 2019-08-09
      • 2019-07-06
      • 2017-06-06
      相关资源
      最近更新 更多