я выполнил следующую строку, и она отлично компилируется:столпотворение-кли не работает с последней заданной
babel src --out-dir lib --presets react,es2015
Но когда я изменяю es2015
к latest
, и запустить его:
babel src --out-dir lib --presets react,latest
я получаю следующее сообщение об ошибке:
TypeError: [BABEL] src/MyComponent.js: Invalid options type for /Users/liadrian/Dev/react-reveal-text/node_modules/babel-preset-latest/lib/index.js
at Logger.error (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/logger.js:39:11)
at OptionManager.mergeOptions (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:243:16)
at /usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:349:14
at /usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:369:24
at Array.map (native)
at OptionManager.resolvePresets (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
at OptionManager.mergePresets (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
at OptionManager.mergeOptions (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)
at OptionManager.init (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:465:10)
at File.initOptions (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/index.js:194:75)
Я считаю это очень странным, потому что я обязательно установил пресет latest
, о чем свидетельствует существование каталога node_modules/babel-preset-latest/
.
И все работает совершенно нормально. Что это за предустановка latest
, вызывающая его? Я пробовал все следующие пресеты, и они отлично работают: es2015
, es2016
, es2017
. Это всего лишь предустановка latest
, которая отключает все.
Любая помощь по поиску и устранению неисправностей будет принята с благодарностью.
EDIT: Мой пакет версии
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-react": "^6.16.0",
Спасибо за предложение. Я пытался это сделать, но похоже, что это происходит. Я редактировал свое оригинальное сообщение с конкретными номерами версий. – adrianmc