Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
运行项目是提示Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
原来是babel版本兼容问题

修改为
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "7.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-loose": "^8.0.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
将高版本的babel配置做降级修改:

同步降级为:
{
"presets": [
["es2015", { "loose": true }],
"stage-1",
"react"
],
"plugins": ["transform-decorators-legacy", "react-hot-loader/babel"]
}
重新 npm run dev 问题解决
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.的更多相关文章
- babel版本兼容报错处理:Plugin/Preset files are not allowed to export objects
原文地址: https://www.cnblogs.com/jiebba/p/9618930.html 1.为什么会报错 ? 这里抱着错误是因为 babel 的版本冲突. 多是因为你的 babel 依 ...
- Plugin/Preset files are not allowed to export objects,webpack报错/babel报错的解决方法
1.为什么会报错 ? 这里抱着错误是因为 babel 的版本冲突. 多是因为你的 babel 依赖包不兼容. 可以查看你的 package.json 的依赖列表 即有 babel 7.0 版本的( @ ...
- MODULE BUILD FAILED: ERROR: COULDN’T FIND PRESET “ES2015” RELATIVE TO DIRECTORY
npm run dev 遇到报错: Module build failed: Error: Couldn't find preset "es2015" relative to di ...
- vue-cli 报Module build failed: Error: No parser and no file path given, couldn't infer a parser.错的解决方法
出错提示如下: ERROR Failed to compile with errors :: error in ./src/App.vue Module build failed: Error: No ...
- vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.
ERROR Failed to compile with 2 errors 12:00:33 error in ./src/App.vue Module build failed: Error: No ...
- 配置web pack loader 报错:Module build failed: Error: The node API for `babel` has been moved to `babel-core`.
报错如下 Module build failed: Error: The node API for `babel` has been moved to `babel-core`. 在我配置loader ...
- Module build failed: Error: Cannot find module 'url-loader' 的坑
本文地址:http://www.cnblogs.com/jying/p/8280956.html 开发环境:react.webpack.es5 引用图片报错:Module build failed: ...
- Vue, element-ui Module build failed: Error: No PostCSS Config found
使用vue框架写pc页面时,我们经常会用到element-ui这个框架. 当我们吧把需要的东西都装在好运行项目的时候,有时会出现这样的错误, Module build failed: Error: N ...
- Module build failed: Error: Cannot find module 'node-sass'
安装npm 遇到 Module build failed: Error: Cannot find module 'node-sass' 这次通过重装 npm 完成 先卸载npm npm uninsta ...
- vue项目报错,解决Module build failed: Error: Cannot find module 'node-sass' 问题
1.报错问题 1 E:\WebStormFile\treehole-manage>npm run dev > xc-ui-pc-sysmanage@1.0.0 dev E:\WebStor ...
随机推荐
- jetbrains账户的注册
注册步骤 1.进入官网界面 官网地址在这里啦:https://www.jetbrains.com/ 官网本来显示的是这个界面: 点击右上角的Learning Tools,然后选择该页面内的这里: 2. ...
- 初认Spring
官网地址:https://spring.io/ Spring Framework的系统架构 1.Core Contiainer:核心容器 2.AOP:面向切片编程 3.Aspects:AOP思想实现 ...
- 本地搭建Stable-Diffusion 教程
前置条件 有一些python的基础 会使用git 有梯子(最好可以全局代理) Windows系统 + 英伟达1060以上显卡 (mac或者linux 以及电脑是AMD显卡,安装的话,可以自行搜索相关教 ...
- Out Of Memory 案例
案例一:老年代内存泄漏 某晚八点收到报警邮件,一看是OOM: 打开 hickwall查看指标:JVM各项指标中 老年代在持续增长(从上次发布10月30号到11月10号的 12天 一直在增长,存在内 ...
- flak_login用法
基础的信息和全局配置这里就不多说,需要用到再斟酌也可以的.这里也是针对每个模块较为常用的进行解释说明,后期再使用过程中遇到会进行补充. Login_Manager LoginManager是一个类,有 ...
- [GIT]指定分支下创建分支
1 解决方案 Eg: master分支下创建 $ git checkout master //切换到master分支下 $ git branch branch_tmp_A //在本地仓库创建临时分支b ...
- 四月十八日java基础知识
1.由于每个对象的pi值都是相同的,所以没有必要让每个对象都保存有自己的pi值,因此将pi声明为静态变量,使之成为所有对象共用的存储空间,所有对象都公用pi这个变量也就是说共用的变量可以设定为静态变量 ...
- Hydra详细使用
1. 简介 Hydra是什么 Hydra是什么: Hydra是一款网络登录破解工具,可以通过暴力破解方式来猜解用户名和密码,从而获取系统的访问权限.它可以支持多种协议,如FTP.SSH.Telnet. ...
- 微信Token验证代码的实现
微信开放第三方API接口, 申请地址: https://mp.weixin.qq.com/advanced/advanced?action=interface&t=advanced/inter ...
- Vue中Key值的一些问题
1. Vue里面的key是一个特殊的变量,在元素当中是不体现出来的 2. 在解析成虚拟DOM的是,如果我们没有写key值,那么这个key就类似于下标 0 , 1 , 2 , 3.... 3. 使用列表 ...