ERROR  Failed to compile with 2 errors                                                                         12:00:33

 error  in ./src/App.vue

Module build failed: Error: No parser and no file path given, couldn't infer a parser.
at normalize (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:7051:13)
at formatWithCursor (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:10370:12)
at C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:31115:15
at Object.format (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:31134:12)
at Object.module.exports (C:\Users\admin\Desktop\222\demo\node_modules\vue-loader\lib\template-compiler\index.js:80:23) @ ./src/App.vue 11:0-354
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js error in ./src/components/HelloWorld.vue Module build failed: Error: No parser and no file path given, couldn't infer a parser.
at normalize (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:7051:13)
at formatWithCursor (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:10370:12)
at C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:31115:15
at Object.format (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:31134:12)
at Object.module.exports (C:\Users\admin\Desktop\222\demo\node_modules\vue-loader\lib\template-compiler\index.js:80:23) @ ./src/components/HelloWorld.vue 11:0-366
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js

解决方法:

npm i prettier@~1.12.0

重新运行:

npm run dev

原因是prettier 更新到1.13.0导致的

欢迎加入大前端交流群!群号:277942610,VIP新群

vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.的更多相关文章

  1. 出现报错: module build failed error couldn't find preset es2015 relative to directory

    当用webpack 进行 build 的时候, 会出现如上标题的错误, 解决方式是在 上级 或者 上上级目录,删除 .babelrc 文件

  2. 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 ...

  3. nuxt/eapress 安装报错Module build failed: ValidationError: PostCSS Loader Invalid OptionsModule build failed: ValidationError: PostCSS Loader Invalid Options options['useConfigFile'] is an invalid additi

    错误信息: Module build failed: ValidationError: PostCSS Loader Invalid Options options['useConfigFile'] ...

  4. webpack搭建项目时出现的报错“Module build failed (from ./node_modules/css-loader/dist/cjs.js) CssSyntaxError”

    控制台出现的错误如下: webpack.config.js中的配置如下: module.exports={ entry:'./src/main.js', output:{ path:__dirname ...

  5. 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 ...

  6. 配置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 ...

  7. Vue, element-ui Module build failed: Error: No PostCSS Config found

    使用vue框架写pc页面时,我们经常会用到element-ui这个框架. 当我们吧把需要的东西都装在好运行项目的时候,有时会出现这样的错误, Module build failed: Error: N ...

  8. Vue.js报错Failed to resolve filter问题原因

    Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错 ...

  9. Module build failed: Error: Cannot find module 'url-loader' 的坑

    本文地址:http://www.cnblogs.com/jying/p/8280956.html 开发环境:react.webpack.es5 引用图片报错:Module build failed: ...

随机推荐

  1. MFC 中MessageBox 显示在所有窗口的最上面

    int MessageBox(   HWND hWnd,          // handle of owner window   LPCTSTR lpText,     // address of  ...

  2. Django中的视图(view)

    视图 1.什么是视图 视图就是Django项目下的view.py文件,它的内部是一系列的函数或者是类,用来专门处理客户端访问请求后处理请求并且返回相应的数据,相当于一个中央情报处理系统 2.具体视图实 ...

  3. AlphaGo的前世今生(一)Deep Q Network and Game Search Tree:Road to AI Revolution

    这一个专题将会是有关AlphaGo的前世今生以及其带来的AI革命,总共分成三节.本人水平有限,如有错误还望指正.如需转载,须征得本人同意. Road to AI Revolution(通往AI革命之路 ...

  4. webpack 4.0配置

    webpack一般是本地安装,一般安装webpack webpack-cli,一般是开发依赖上线的时候不需要打包通常npm install webpack webpack-cli  -D安装 安装的时 ...

  5. Mysql表结构导出excel(含数据类型、字段备注注释)

    SELECT   "列名",   "数据类型",     "字段类型",   "长度",  "是否为空&quo ...

  6. unable to resolve module react-native-gesture-handler from

    在安装了npm install --save react-navigation后跑项目然后就红屏了. 解决方法: 安装触摸方式(需要执行以下方法) npm install --save react-n ...

  7. hibernate写list到mysql

    用jpa写下面语句执行报错,估计要先手动转成字符串吧,工作忙没继续下去了. public void persist(Goods goods) { Assert.notNull(goods);// go ...

  8. 深入理解C++11

    [深入理解C++11] 1.很多 现实 的 编译器 都 支持 C99 标准 中的__ func__ 预定 义 标识符 功能, 其 基本 功能 就是 返回 所在 函数 的 名字. 编译器 会 隐式 地 ...

  9. Unity3d项目入门之虚拟摇杆

    Unity本身不提供摇杆的组件,开发者可以使用牛逼的EasyTouch插件或者应用NGUI实现相关的需求,下面本文通过Unity自身的UGUI属性,实现虚拟摇杆的功能. 主参考 <Unity:使 ...

  10. Unity Awards 2018最佳资源

    好的工具与资源,将帮助你的开发,达到事办功倍,今天我们将为大家介绍荣获Unity Awards 2018最佳资源的获奖作品. 最佳艺术工具:Aura - Volumetric Lighting Aur ...