で作業していませんバベル-cliを私は次の行を実行してきたが、それがうまくコンパイル最新のプリセット
私は次のエラーを取得する:
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)
node_modules/babel-preset-latest/
ディレクトリの存在が示すように、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