使用vite构建vue3项目中遇到的问题

245 阅读1分钟
  • 问题一

git bash中使用npm init vite@latest这个指令构建vue3项目的话,上下箭头移动不了

解决:

使用指令winpty npm.cmd init @vitejs/app vue3

  • 问题二

把项目在vscode中打开的话,使用npm run dev运行时,报错:'vite' 不是内部或外部命令,也不是可运行的程序

解决:npm i把所有依赖下载下来

  • 问题三

vue3中template下根标签可以有多个,此时会报错The template root requires exactly one element.

解决 Validate vue-html in <template> using eslint-plugin-vue

image-20220325153411919.png