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:UsersadminDesktop222demo ode_modulesprettierindex.js:7051:13) at formatWithCursor (C:UsersadminDesktop222demo ode_modulesprettierindex.js:10370:12) at C:UsersadminDesktop222demo ode_modulesprettierindex.js:31115:15 at Object.format (C:UsersadminDesktop222demo ode_modulesprettierindex.js:31134:12) at Object.module.exports (C:UsersadminDesktop222demo ode_modulesvue-loaderlib emplate-compilerindex.js:80:23) @ ./src/App.vue 11:0-354 @ ./src/main.js @ multi (webpack)-dev-server/client?http://localhost:8081 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 (C:UsersadminDesktop222demo ode_modulesprettierindex.js:7051:13) at formatWithCursor (C:UsersadminDesktop222demo ode_modulesprettierindex.js:10370:12) at C:UsersadminDesktop222demo ode_modulesprettierindex.js:31115:15 at Object.format (C:UsersadminDesktop222demo ode_modulesprettierindex.js:31134:12) at Object.module.exports (C:UsersadminDesktop222demo ode_modulesvue-loaderlib emplate-compilerindex.js:80:23) @ ./src/components/HelloWorld.vue 11:0-366 @ ./src/router/index.js @ ./src/main.js @ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js
解觉方法:
npm i prettier@~1.12.0
重新运行:
npm run dev