我只是使用webpack模板设置一个vue项目,如下所示:http://vuejs-templates.github.io/webpack/
但是在运行npm run dev之后只是为了测试模板是否正常工作,我得到了这个错误:
Failed to compile with 2 errors 21:49:02
error in ./src/App.vue
Module build failed: Error: No parser and no file path given, couldn't infer a parser.
at normalize (path\node_modules\prettier\index.js:7051:13)
at formatWithCursor (path\node_modules\prettier\index.js:10370:12)
at path\node_modules\prettier\index.js:31115:15
at Object.format (path\node_modules\prettier\index.js:31134:12)
at Object.module.exports (path\node_modules\vue-loader\lib\template-compiler\index.js:80:23)
@ ./src/App.vue 11:0-354
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./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 (path\node_modules\prettier\index.js:7051:13)
at formatWithCursor (path\node_modules\prettier\index.js:10370:12)
at …Run Code Online (Sandbox Code Playgroud) 在尝试使用构建新的webpack项目时,我反复收到错误vue-cli.我正在关注最新版本(3.0.0-beta.11)上的文档,也尝试使用早期版本,而不是测试版.
当我运行yarn serve它时尝试启动开发服务器并构建项目但在此处失败:
error in ./src/App.vue?vue&type=template&id=7ba5bd90
Module build failed: Error: No parser and no file path given, couldn't infer a parser.
at normalize (/Users/cory/Code/chickadee/my-project/node_modules/prettier/index.js:7051:13)
at formatWithCursor (/Users/cory/Code/chickadee/my-project/node_modules/prettier/index.js:10370:12)
at /Users/cory/Code/chickadee/my-project/node_modules/prettier/index.js:31115:15
at Object.format (/Users/cory/Code/chickadee/my-project/node_modules/prettier/index.js:31134:12)
at actuallyCompile (/Users/cory/Code/chickadee/my-project/node_modules/@vue/component-compiler-utils/dist/compileTemplate.js:93:29)
at compileTemplate (/Users/cory/Code/chickadee/my-project/node_modules/@vue/component-compiler-utils/dist/compileTemplate.js:26:16)
at Object.module.exports (/Users/cory/Code/chickadee/my-project/node_modules/vue-loader/lib/loaders/templateLoader.js:42:20)
@ ./src/App.vue?vue&type=template&id=7ba5bd90 1:0-194 1:0-194
@ ./src/App.vue
@ ./src/main.js
@ multi (webpack)-dev-server/client/index.js (webpack)/hot/dev-server.js ./src/main.js
Run Code Online (Sandbox Code Playgroud)
yarnvue-cli生成新项目.项目生成并安装模块.prettier模块,但似乎仍然出现错误.还有什么可以尝试通过此错误?