运行项目时候出现的问题

Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。

PS C:\Users\Administrator> cd E:\projectwork\vuework\sell
PS E:\projectwork\vuework\sell> npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

up to date in 6.508s
PS E:\projectwork\vuework\sell> npm run dev

> sell@1.0.0 dev E:\projectwork\vuework\sell
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 94% asset optimization

 ERROR  Failed to compile with 2 errors                                                                         23:18:23
 error  in ./src/App.vue

Module build failed: Error: No parser and no file path given, couldn't infer a parser.
    at normalize (E:\projectwork\vuework\sell\node_modules\prettier\index.js:7051:13)
    at formatWithCursor (E:\projectwork\vuework\sell\node_modules\prettier\index.js:10370:12)
    at E:\projectwork\vuework\sell\node_modules\prettier\index.js:31115:15
    at Object.format (E:\projectwork\vuework\sell\node_modules\prettier\index.js:31134:12)
    at Object.module.exports (E:\projectwork\vuework\sell\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 (E:\projectwork\vuework\sell\node_modules\prettier\index.js:7051:13)
    at formatWithCursor (E:\projectwork\vuework\sell\node_modules\prettier\index.js:10370:12)
    at E:\projectwork\vuework\sell\node_modules\prettier\index.js:31115:15
    at Object.format (E:\projectwork\vuework\sell\node_modules\prettier\index.js:31134:12)
    at Object.module.exports (E:\projectwork\vuework\sell\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:8080 webpack/hot/dev-server ./src/main.js
                                                                                                 终止批处理操作吗(Y/N)? y
PS E:\projectwork\vuework\sell> npm install vue-loader
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ vue-loader@13.7.2
updated 1 package in 41.902s
PS E:\projectwork\vuework\sell> npm run dev

> sell@1.0.0 dev E:\projectwork\vuework\sell
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 95% emitting

 DONE  Compiled successfully in 3548ms                                                                          23:33:43
 I  Your application is running here: http://localhost:8080

百度、谷歌搜索问题所在,相信蛮多朋友也会遇到这种问题,只需要安装安装"vue-loader": "11.1.4",可解决问题


好了,如果有不懂的问题,可以关注我的个人微信公众号和我交流


Logo

前往低代码交流专区

更多推荐