ReferenceError: [BABEL] src / app.js: неизвестная опция - PullRequest
0 голосов
/ 26 августа 2018

Используемая версия Babel 6.24.1 (babel-core 6.26.3)

Я пытаюсь автоматически сгенерировать 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"
  }
}
...