- Problem: The version of vite is too low, which leads to an error.
Solution: Modify the version of vite in package.json and execute npm i
"devDependencies": {
"vite": "^2.8.6",
"@vue/compiler-sfc": "^3.0.4"
}
- Could not find module 'path' or its corresponding type declaration
npm install @types/node --save-dev
- Cannot find module '@vitejs/plugin-vue' or its corresponding type declaration.
npm install vite @vitejs/plugin-vue -D -w
- npm run dev fails to start the project
. Reason: The version of the vite plugin is inconsistent with that of vite
. Solution:
npm install -D vite@^3