首页 > 其他 > 详细

【Vue报错】Module build failed: Error: No parser and no file path given, couldn't infer a p arser.

时间:2018-05-28 19:44:26      阅读:689      评论:0      收藏:0      [点我收藏+]

在创建一个vue项目启动时报错,报错的内容为: 
error in ./src/App.vue

Module build failed: Error: No parser and no file path given, couldn’t infer a p 
arser. 
at UndefinedParserError.Wrapper (D:\dyyc\bookstore\node_modules_prettier@1. 
13.0@prettier\index.js:1948:14) 
at new UndefinedParserError (D:\dyyc\bookstore\node_modules_prettier@1.13.0 
@prettier\index.js:2055:83) 
at normalize (D:\dyyc\bookstore\node_modules_prettier@1.13.0@prettier\index 
.js:7051:13) 
at formatWithCursor (D:\dyyc\bookstore\node_modules_prettier@1.13.0@prettie 
r\index.js:10370:12) 
at D:\dyyc\bookstore\node_modules_prettier@1.13.0@prettier\index.js:31115:1 

at Object.format (D:\dyyc\bookstore\node_modules_prettier@1.13.0@prettier\i 
ndex.js:31134:12) 
at Object.module.exports (D:\dyyc\bookstore\node_modules_vue-loader@13.7.1@ 
vue-loader\lib\template-compiler\index.js:80:23)

@ ./src/App.vue 11:0-392 
@ ./src/main.js 
@ multi ./node_modules/_webpack-dev-server@2.11.2@webpack-dev-server/client?htt 
p://localhost:8082 webpack/hot/dev-server ./src/main.js

 

原因是prettier 更新到1.13.1导致的,component-compiler-utils 1.3.1 已经更新修复了.

【解决方法】:

1、node_modules下面的_prettier@1.13.0@prettier文件夹删除

2、控制台安装  cnpm install --save-dev prettier@1.12.0

3、控制台运行 cnpm run dev

【Vue报错】Module build failed: Error: No parser and no file path given, couldn't infer a p arser.

原文:https://www.cnblogs.com/yan0802/p/9101831.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!