vue项目创建时报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.

在创建一个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
5
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模块导致的报错,查了下发现In prettier 1.13.0, default parser was removed with a minor version(used to be babylon), this breaks the formatter here.意思是在prettier的 1.13.0版本,默认的一个解析器被移除了导致项目创建失败

解决办法把node_modules里的prettier删掉,重现下个之前的版本 npm install prettier@~1.12.0再运行就可以了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值