Module build failed (from ./node_modules/babel-loader/lib/index.js): ReferenceError: [BABEL]

仇航
2023-12-01
Module build failed (from ./node_modules/babel-loader/lib/index.js):
ReferenceError: [BABEL] C:\Users\jake\Desktop\react-review\src\main.js: Unknown option: C:\Users\jake\Desktop\react-review\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 https://babeljs.io/docs/en/plugins#pluginpresets-options. (While processing preset: "C:\\Users\\jake\\Desktop\\react-review\\node_modules\\react\\index.js")

解决方法:

yarn add babel-preset-react --dev
或者
npm install babel-preset-react --save-dev

 类似资料: