vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.(

Posted 你丫才美工

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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, couldnt infer a parser.
    at normalize (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:7051:13)
    at formatWithCursor (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:10370:12)
    at C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:31115:15
    at Object.format (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:31134:12)
    at Object.module.exports (C:\Users\admin\Desktop\222\demo\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: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, couldnt infer a parser.
    at normalize (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:7051:13)
    at formatWithCursor (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:10370:12)
    at C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:31115:15
    at Object.format (C:\Users\admin\Desktop\222\demo\node_modules\prettier\index.js:31134:12)
    at Object.module.exports (C:\Users\admin\Desktop\222\demo\node_modules\vue-loader\lib\template-compiler\index.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 [email protected]~1.12.0

重新运行:

npm run dev

 

以上是关于vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.(的主要内容,如果未能解决你的问题,请参考以下文章

VUE报错:Module build failed: Error: Cannot find module ‘node-sass‘

Module build failed: Error: Cannot find module ‘node-sass‘ Require stack报错解决

运行node.js报错:Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } j

vue -Missing space before value for key 'path'vue.js解决空格报错

Module build failed: Error: Cannot find module 'file-loader'

vue.js - 基本配置