VUE KOA编译报错Module build failed: Error: Plugin/Preset files are not allowed to export objects

VUE KOA编译的时候出现了以下问题


Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/yld/Documents/work/YLD/samyoc_admin/node_modules/backpack-core/babel.js
    at createDescriptor (/Users/yld/Documents/work/YLD/samyoc_admin/node_modules/@babel/core/lib/config/config-descriptors.js:178:11)
    at items.map (/Users/yld/Documents/work/YLD/samyoc_admin/node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
    at Array.map ()
    at createDescriptors (/Users/yld/Documents/work/YLD/samyoc_admin/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
    at createPresetDescriptors (/Users/yld/Documents/work/YLD/samyoc_admin/node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
    at passPerPreset (/Users/yld/Documents/work/YLD/samyoc_admin/node_modules/@babel/core/lib/config/config-descriptors.js:58:96)
    at cachedFunction (/Users/yld/Documents/work/YLD/samyoc_admin/node_modules/@babel/core/lib/config/caching.js:33:19)

 

Winter2018/11/14 17:58:35

搜了很久的资料发现是插件不兼容的问题

我在package.json里面加入了如下的代码,如果你也遇到这个问题,可以尝试把对应的版本改为如下的


    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-env": "^1.6.1",
    "babel-preset-stage-0": "^6.24.1",