小bug操作: This dependency was not found:

版权声明:转载请联系[email protected] https://blog.csdn.net/dongzhiliwansui/article/details/87888826

This dependency was not found:
[1] * SubType 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/components/SuperType.vue?vue&type=script&lang=js&
[1]
[1] To install it, you can run: npm install --save SubType

报错原因: 找不到 对应的SubType.vue
解决方式: 路径不对, 具体可以上面报错的提示具体的路径 即SuperType.vue中代码

  • SuperType.vue中代码为
    import SubType from ‘SubType’ 本来是想引用一个文件,忙碌写错了,
    • Vue认为 'SubType’是一个npm 的包
    • Vue建议 npm install -S SubType 但是这种建议实际上是错误的, 因为Vue是根据写错的代码 来建议修复这个错误
    • 所以综上 仅仅只是修改下路径为 import SubType from './SubType.vue’即可, 而而不是Vue建议的安装包来解决。

总结:
Vue提示的错误以及路径信息可以参考
Vue建议的某些操作 需要结合具体的错误信息分析和对应的项目需求和环境 来考虑 是否采用其建议

猜你喜欢

转载自blog.csdn.net/dongzhiliwansui/article/details/87888826