码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2018-05-28 14:46:39      阅读:409      评论:0      收藏:0      [点我收藏+]

标签:des   mat   file   app   npm   vue.js   src   min   localhost   

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 prettier@~1.12.0

重新运行:

npm run dev

 

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

标签:des   mat   file   app   npm   vue.js   src   min   localhost   

原文地址:https://www.cnblogs.com/tw6668/p/9099647.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!