ReferenceError:[BABEL] src / app.js:未知选项

时间:2018-08-26 12:05:25

标签: reactjs babel

我正在使用6.24.1 (babel-core 6.26.3)的babel版本

我正在尝试通过执行以下操作从源app.js中自动生成脚本中的app.js文件

babel src/app.js --out-file=public/scripts/app.js --presets=env,react 我收到以下错误:

`ReferenceError: [BABEL] src/app.js: Unknown option: /home/my-pc/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: "/home/my-pc/node_modules/react/index.js")
`

package.json

{
  "name": "indecision-app",
  "version": "1.0.0",
  "main": "index.js",
  "author": "Sid",
  "license": "MIT",
  "dependencies": {
    "babel-preset-env": "1.5.2",
    "babel-preset-react": "6.24.1"
  }
}

0 个答案:

没有答案