1

在这种情况下,我真的不明白什么是重要信息。

我看到几个目录和几个文件。

...node_modules/react-native-katex/src/index.js: Unknown option: .../node_modules/react/index.js.Children. Check out http://babeljs.io/docs/usage/options/ for more information about options.

A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

Invalid:
  `{ presets: [{option: value}] }`
Valid:
  `{ presets: [['presetName', {option: value}]] }`

For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options. (While processing preset: "/.../node_modules/react/index.js")

特别令人困惑的是Unknown option: .../node_modules/react/index.js.Children.

react-native-katex 中的 .babelrc 文件如下所示:

{
"presets": [
    "react",
    ["env", {
      "targets": {
        "browsers": ["last 2 versions"],
        "node": 8
      }
    }]
  ],
  "plugins": [
    "transform-object-rest-spread",
    "transform-class-properties"
  ]
}

我敢打赌问题出在 react-native katex 包上,但我不确定要寻找什么或从哪里开始。此错误仅在为生产构建时出现。

4

0 回答 0