Error while running vite project: 'vite' is not recognized as an internal or external command, operable program or batch file.

Article directory

Report an error

Insert image description here

analyze

Because when using vite to create a vue3.0 project, vite will not automatically help us install related dependencies. We need to install them manually. Then I went to the node_modules directory of the project to check, and sure enough there was nothing.

So the reason for this problem is: the missing step of installing dependencies! Unlike node or cli, vite will automatically help us execute the npm i (install) command to download related dependencies. We need to download them manually.

solve

Install dependencies

npm install

run again

npm run dev

Insert image description here

Guess you like

Origin blog.csdn.net/qq_53810245/article/details/129684767