Требуется Babel «^ 7.0.0-0», но был загружен «6.26.3» - PullRequest
0 голосов
/ 27 января 2019

Я не могу понять эту ошибку.Это связано с реакцией 16.7.0 или обновлением mdbreact.Я обновил свое приложение примерно в то же время, когда появились эти ошибки.Я следил за документацией к веб-пакам и вавилонам.Я также добавил объект модуля в файл webpack.config, который позаботился о предыдущих сообщениях об ошибках.

Я запустил yarn add babel-jest babel-core@^7.0.0-0, но он вызвал еще одну ошибку.

ERROR in ./src/index.js
Module build failed (from ../node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\babel-preset-react\lib\index.js
    at createDescriptor (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:178:11)
    at items.map (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:109:50)
    at Array.map (<anonymous>)
    at createDescriptors (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
    at createPresetDescriptors (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
    at passPerPreset (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:58:96)
    at cachedFunction (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\caching.js:33:19)
    at presets.presets (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:29:84)
    at mergeChainOpts (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-chain.js:320:26)
    at C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-chain.js:283:7
    at buildRootChain (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-chain.js:68:29)
    at loadPrivatePartialConfig (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\partial.js:85:55)
    at loadFullConfig (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\full.js:43:39)
    at transformSync (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\transform.js:41:38)
    at Object.transform (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\transform.js:22:38)
    at transpile (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\babel-loader\lib\index.js:50:20)
    at C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\babel-loader\lib\fs-cache.js:118:18
    at ReadFileContext.callback (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\babel-loader\lib\fs-cache.js:31:21)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:238:13)
 @ multi babel-polyfill ./src/index.js app[1]

ERROR in ../node_modules/babel-polyfill/lib/index.js
Module build failed (from ../node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\babel-preset-react\lib\index.js
    at createDescriptor (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:178:11)
    at items.map (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:109:50)
    at Array.map (<anonymous>)
    at createDescriptors (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
    at createPresetDescriptors (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
    at passPerPreset (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:58:96)
    at cachedFunction (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\caching.js:33:19)
    at presets.presets (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-descriptors.js:29:84)
    at mergeChainOpts (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-chain.js:320:26)
    at C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-chain.js:283:7
    at buildRootChain (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\config-chain.js:68:29)
    at loadPrivatePartialConfig (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\partial.js:85:55)
    at loadFullConfig (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\config\full.js:43:39)
    at transformSync (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\transform.js:41:38)
    at Object.transform (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\@babel\core\lib\transform.js:22:38)
    at transpile (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\babel-loader\lib\index.js:50:20)
    at C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\babel-loader\lib\fs-cache.js:118:18
    at ReadFileContext.callback (C:\Users\Owner\Desktop\test\phr-india-ui\node_modules\babel-loader\lib\fs-cache.js:31:21)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:238:13)
 @ multi babel-polyfill ./src/index.js app[0]


...