原因是prettier 更新到1.13.1导致的
component-compiler-utils 1.3.1 已经更新修复了.
现在不需要把1.13.1 降级了
具体, https://github.com/vuejs/comp...
error
in ./src/App.vue
Module build failed: Error: No parser and no file path given, couldn't infer a parser.
at normalize (F:\WebStormProjects\a9043-blog-mobile\node_modules\prettier\index.js:7051:13)
at formatWithCursor (F:\WebStormProjects\a9043-blog-mobile\node_modules\prettier\index.js:10370:12)
at F:\WebStormProjects\a9043-blog-mobile\node_modules\prettier\index.js:31115:15
at Object.format (F:\WebStormProjects\a9043-blog-mobile\node_modules\prettier\index.js:31134:12)
at Object.module.exports (F:\WebStormProjects\a9043-blog-mobile\node_modules\vue-loader\lib\template-compiler\index.js:80:23)
解决办法
npm install --save-dev prettier@1.12.0
npm run dev
本文解决了由于Prettier升级至1.13.1版本而导致的组件编译错误问题。通过降级Prettier版本并更新component-compiler-utils至1.3.1,成功解决了Vue项目中出现的无法推断解析器的问题。

被折叠的 条评论
为什么被折叠?



