Common problems encountered in vite installation and configuration ts

  1. 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"
  }
  1. Could not find module 'path' or its corresponding type declaration
npm install @types/node --save-dev
  1. Cannot find module '@vitejs/plugin-vue' or its corresponding type declaration.
npm install vite @vitejs/plugin-vue -D -w
  1. npm run dev fails to start the project
    insert image description here. Reason: The version of the vite plugin is inconsistent with that of vite
    . Solution:
npm install -D vite@^3

Guess you like

Origin blog.csdn.net/qq_46258819/article/details/128914075