ERROR  Failed to compile with 2 errors                                                                                  上午8:38:06
These relative modules were not found:

* ./Logo in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/layout/index.vue?vue&type=script&lang=js&
* ./SidebarItem in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/layout/index.vue?vue&type=script&lang=js&

这种报错大多数都是路径问题,我这里是找到报错位置,补全代码就行了

import Logo from './components/Sidebar/Logo.vue'
import SidebarItem from './components/Sidebar/SidebarItem.vue'

遇到这种问题不要慌,先 npm install 一下

如果不报错,就说明依赖没有问题,那大概率就是路径的问题了。

学习没有捷径,慢慢解决bug,慢慢前进

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐