完整报错:

NUXT报错解决Could not compile template XXX:Cannot resolve XX from XX
使用npm run dev启动自己的项目时产生的报错。查找该报错信息中路径时发现并未找到自己的磁盘中存在该文件。怀疑可能是依赖不完整导致文件无法找到。
使用npm install或cnpm install安装依赖: 仍然报错。
NUXT报错解决Could not compile template XXX:Cannot resolve XX from XX
查看nuxt.config.js文件,发现该css文件上在此处引入。查找绝对路径,找到nuxt-swiper-plugin.js文件:
NUXT报错解决Could not compile template XXX:Cannot resolve XX from XX
怀疑vue-awesome-swiper依赖并未引入,通过cnpm install vue-awesome-swiper或npm install vue-awesome-swiper安装,成功运行:
NUXT报错解决Could not compile template XXX:Cannot resolve XX from XX
NUXT报错解决Could not compile template XXX:Cannot resolve XX from XX
NUXT报错解决Could not compile template XXX:Cannot resolve XX from XX
cnpm install或npm install无法引入该依赖的原因是:
cnpm install是根据package.json去决定你所需要引入的依赖,而像我这样并未在package.json中引入该依赖,就会导致报错

相关文章:

  • 2021-06-20
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2021-09-07
  • 2022-12-23
猜你喜欢
  • 2018-05-14
  • 2022-12-23
  • 2022-01-04
  • 2021-06-19
  • 2021-04-19
  • 2022-01-22
相关资源
相似解决方案