出错提示如下:

 ERROR  Failed to compile with  errors                                 ::

 error  in ./src/App.vue

Module build failed: Error: No parser and no file path given, couldn't infer a p
arser.
at normalize (D:\works\node_modules\prettier\index.js::)
at formatWithCursor (D:\works\node_modules\prettier\index.js::)
at D:\works\node_modules\prettier\index.js::
at Object.format (D:\works\node_modules\prettier\index.js::)
at Object.module.exports (D:\works\node_modules\vue-loader\lib\template-compiler\index.js::) @ ./src/App.vue :-
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-serve
r ./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 (D:\works\node_modules\prettier\index.js::)
at formatWithCursor (D:\works\node_modules\prettier\index.js::)
at D:\works\node_modules\prettier\index.js::
at Object.format (D:\works\node_modules\prettier\index.js::)
at Object.module.exports (D:\works\node_modules\vue-loader\lib\template-compiler\index.js::) @ ./src/components/HelloWorld.vue :-
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-serve
r ./src/main.js

解决方法是安装prettier

npm i prettier@~1.12.

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

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

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

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

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

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

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

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

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

  7. Module build failed: Error: Cannot find module 'node-sass'

    安装npm 遇到 Module build failed: Error: Cannot find module 'node-sass' 这次通过重装 npm 完成 先卸载npm npm uninsta ...

  8. 【Problem】前端项目运行:Module build failed:Error Node Sass does not yet support my current environmen

    我在运行renren-fast-vue前端项目时,安装完依赖cnpm install 启动服务npm run dev 出现问题. Module build failed: Error: Node Sa ...

  9. vue项目npm run dev 报错error in ./src/main.js Module build failed: Error: Cannot find module 'babel-plugin-syntax-jsx'

    问题: vue 项目npm run dev运行时报错,如下图:  原因: 缺少相应的组件 解决办法: 安装相应组件: npm install babel-plugin-syntax-jsx --sav ...

随机推荐

  1. 浏览器输入url回车后,会发生什么?

    通常我们想访问某一个网址,我们会在浏览器中输入它的域名,然后点击回车进行跳转,这样就可以进到网站的主页,看似简单的两步,其实背后都需要大量的代码在运行,支持,才能完成!那浏览器到底都做了哪些事呢? 一 ...

  2. 如何编译luabind支持vs2010之后所有版本

    步骤 下载https://github.com/luabind/luabind/tree/0.9. 其最后一次commit为 Revision: 8c66030818f0eacbb7356c16776 ...

  3. GitHub Pages:静态站点托管服务(待补充)

    不管是 react 还是 vue 项目路由都必须使用 hash 方式,否则页面打不开,切记!!! 如果使用的是 vue-cli 3 创建项目,那么你要在根目录创建 vue.config.js 文件,并 ...

  4. 【java】内部类

    内部类:将一个类定义在另一个类里.对里面的那个类就是内部类. 访问特点: 1.内部类可以直接访问外部类的成员,包括私有.之所以可以直接访问外部类中的成员,是因为内部类中持有了一个外部的引用,格式 外部 ...

  5. JetBrains GoLand 注册码

    选择license server 输入 http://idea.youbbs.org 完成 要求联网

  6. IMU(LPMS-B2) ROS下使用教程

    一.基本信息 http://www.alubi.cn/lpms-b2/ 安装ros教程 http://wiki.ros.org/lpms_imu https://lp-research.com/ros ...

  7. 转:嵌入式: jffs2,yaffs2,logfs,ubifs文件系统性能分析

    原文地址: http://blog.chinaunix.net/uid-23381466-id-3411483.html. 在嵌入式领域,FLASH是一种常用的存储介质,由于其特殊的硬件结构,所以普通 ...

  8. react优缺点

    优点: 1.面向组件,方便组件的复用. 2.从操作dom改为操作state. 缺点: 1.html和javascript较高耦合,不方便分工开发. 2.当一个页面中两处元素组件有相关性时,父组件会非常 ...

  9. Python【每日一问】09

    问:请分别写一段Python代码实现一下功能: (1)计算一个文件中的大写字母数量 (2)输入中文,返回相应的拼音,并写入文件中 答: (1)计算一个文件中的大写字母数量 file_name = &q ...

  10. Google SketchUp Cookbook: (Chapter 5) Roofs: Constraints and Inferences

    软件环境 SketchUp Pro 2018 参考书籍 Google SketchUp Cookbook Creating an Overhanging Roof 屋顶上有一个缝隙需要填充,有两种方法 ...