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

在创建一个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\[email protected] 
[email protected]\index.js:1948:14) 
at new UndefinedParserError (D:\dyyc\bookstore\[email protected] 
@prettier\index.js:2055:83) 
at normalize (D:\dyyc\bookstore\[email protected]@prettier\index 
.js:7051:13) 
at formatWithCursor (D:\dyyc\bookstore\[email protected]@prettie 
r\index.js:10370:12) 
at D:\dyyc\bookstore\[email protected]@prettier\index.js:31115:1 

at Object.format (D:\dyyc\bookstore\[email protected]@prettier\i 
ndex.js:31134:12) 
at Object.module.exports (D:\dyyc\bookstore\[email protected]@ 
vue-loader\lib\template-compiler\index.js:80:23)

@ ./src/App.vue 11:0-392 
@ ./src/main.js 
@ multi ./node_modules/[email protected]@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下面的[email protected]@prettier文件夹删除

2、控制台安装  cnpm install --save-dev [email protected]

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

时间: 2024-12-05 09:39:21

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

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 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 form

vue报错 Module not found: Error: Cannot resolve 'file' or 'directory'

炸了,我好写sell而组件,直接就用了,我的天哪 看你的写了吗,就用: Module not found: Error: Cannot resolve 'file' or 'directory' 页另一种错误,按这种情况我没遇到:http://www.mamicode.com/info-detail-1564042.html vue报错 Module not found: Error: Cannot resolve 'file' or 'directory'

Module build failed: Error: Cannot find module 'node-sass’解决

在 npm run dev 时出现 ” Module build failed: Error: Cannot find module 'node-sass’ “ 这样的错误,如下: ERROR Failed to compile with 1 errors 19:51:09 error in ./src/page/Class/ClassList.vue Module build failed: Error: Cannot find module 'node-sass' Require stack

使用PHPMailer 中的报错解决 "Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:"

PHPMailer项目地址:https://github.com/PHPMailer/PHPMailer 项目中用到PHPMailer,使用过程中报错:"Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:" 由于我用的第三方smtp是ssl链接,所以需要再添加一些参数: $mail->SMTPOptions =

针对Flex+Java使用RemoteObject通讯 报错Channel.Connect.Failed error NetConnection.Call.Failed 404

今天在Flex中使用RemoteObject进行java调用时,报错 [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/UnitCi

移动vue项目,启动错误:Module build failed: Error: No PostCSS Config found in:

解决办法:在根目录新建postcss.config.js module.exports = { plugins: { 'autoprefixer': {browsers: 'last 5 version'} } } 然后再次启动项目即可解决 原文地址:https://www.cnblogs.com/johnjackson/p/10783075.html

Module build failed: Error: No PostCSS Config found

使用vue框架写pc页面时,我们经常会用到element-ui这个框架. 当我们把需要的东西都装在好运行项目的时候,有时会出现这样的错误: 这是因为缺少了一个配置文件,postcss.config.js,配置内容如下 module.exports = { plugins: { 'autoprefixer': {browsers: 'last 5 version'} } } 注意:这个文件是放在项目的根目录下的 原文地址:https://www.cnblogs.com/caoxueying2018

webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-env' from '...' - Did you mean "@babel/env"?

webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-env' from '...' - Did you mean "@babel/env"? 原因: babel-core和babel-preset-env依赖被替换为@babel/core和@babel/preset-env,因为新版本的Babel7中对

Xamarin 示例Standard Controls报错:xamarin Failed to compile interface file. See Build Output for details

Standard Controls 示例下载地址: http://developer.xamarin.com/content/StandardControls/ Xamarin官网上的IOS示例“Standard Controls”编译报错: xamarin  Failed to compile interface file. See Build Output for details 搜索Xamarind 的forums,有几个帖子是关于相同错误信息的,貌似最权威的解答是下面这个: http:/