欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

建立vue项目遇到的一些问题

程序员文章站 2022-03-22 10:01:31
初始化vue项目过程整理第一次建立vue项目,遇到了很多问题用命令行vue init ex3建立vue项目,运行npm run dev,出现报错 ERROR Failed to compile with 9 errors These dependencies were not found:* !!vue-style-loa...

初始化vue项目过程整理


第一次建立vue项目,刚开始就出了问题

用命令行vue init ex3建立vue项目,运行npm run dev,出现报错

 ERROR  Failed to compile with 9 errors                                                                                        
These dependencies were not found:

* !!vue-style-loader!css-loader?{"sourceMap":true}!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-7ba5bd90","scoped":false,"hasInlineConfig":false}!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=styles&index=0!../../../../..!web/vue/文档/ex3/src/App.vue in ./src/App.vue
* !../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/component-normalizer in ./src/App.vue
* !!babel-loader!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=script&index=0!../../../../..!web/vue/文档/ex3/src/App.vue in ./src/App.vue
* !!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/template-compiler/index?{"id":"data-v-7ba5bd90","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=template&index=0!../../../../..!web/vue/文档/ex3/src/App.vue in ./src/App.vue
* !!vue-style-loader!css-loader?{"sourceMap":true}!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-469af010","scoped":true,"hasInlineConfig":false}!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=styles&index=0!../../../../../..!web/vue/文档/ex3/src/components/HelloWorld.vue in ./src/components/HelloWorld.vue
* !../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/component-normalizer in ./src/components/HelloWorld.vue
* !!babel-loader!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=script&index=0!../../../../../..!web/vue/文档/ex3/src/components/HelloWorld.vue in ./src/components/HelloWorld.vue
* !!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/template-compiler/index?{"id":"data-v-469af010","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=template&index=0!../../../../../..!web/vue/文档/ex3/src/components/HelloWorld.vue in ./src/components/HelloWorld.vue
* F:\!web\vue\文档\ex3\node_modules\webpack-dev-server\client\index.js?http://localhost:8080 in multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

To install them, you can run: npm install --save !!vue-style-loader!css-loader?{"sourceMap":true}!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-7ba5bd90","scoped":false,"hasInlineConfig":false}!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=styles&index=0!../../../../..!web/vue/文档/ex3/src/App.vue !../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/component-normalizer !!babel-loader!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=script&index=0!../../../../..!web/vue/文档/ex3/src/App.vue !!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/template-compiler/index?{"id":"data-v-7ba5bd90","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=template&index=0!../../../../..!web/vue/文档/ex3/src/App.vue !!vue-style-loader!css-loader?{"sourceMap":true}!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-469af010","scoped":true,"hasInlineConfig":false}!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=styles&index=0!../../../../../..!web/vue/文档/ex3/src/components/HelloWorld.vue !../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/component-normalizer !!babel-loader!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=script&index=0!../../../../../..!web/vue/文档/ex3/src/components/HelloWorld.vue !!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/template-compiler/index?{"id":"data-v-469af010","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!../../../../../..!web/vue/文档/ex3/node_modules/vue-loader/lib/selector?type=template&index=0!../../../../../..!web/vue/文档/ex3/src/components/HelloWorld.vue F:\!web\vue\文档\ex3\node_modules\webpack-dev-server\client\index.js?http://localhost:8080


 WAIT  Compiling...                                                                                                            
  0% compiling

尝试过网上介绍的各种方法,比如安装依赖:

npm install stylus-loader css-loader style-loader --save-dev
npm install less less-loader --save-dev
npm install sass sass-loader --save-dev

或者删除项目中的node_modules后重新用npm install安装依赖,然后再次执行npm run dev,仍然报错,且错误相同
最后发现是路径上文件名的问题…
把路径上的中文名和特殊符号去掉后就可以成功运行了

 DONE  Compiled successfully in 30539ms                    
 I  Your application is running here: http://localhost:8080

终于可以开始愉快的学习vue啦:-D

本文地址:https://blog.csdn.net/pekaboo/article/details/107381645

相关标签: vue