Debug School

rakesh kumar
rakesh kumar

Posted on

vite' is not recognized as an internal or external command, operable program or batch file.

Problem : while i run command npm run build

INFO Caching the framework bootstrap files.

build
vite build

'vite' is not recognized as an internal or external command,
operable program or batch file.

This error message occurs when you try to run the npm run build command and the system cannot find the vite executable. The error message suggests that vite is not recognized as an internal or external command, operable program or batch file, indicating that it is not installed on your system or not in your system's PATH environment variable.

Here are a few steps you can try to resolve this issue:

Install Vite: If you haven't already installed Vite, you can do so by running the following command:

npm install -g vite
Enter fullscreen mode Exit fullscreen mode

This will install Vite globally on your system.

Check the PATH environment variable: Make sure that the PATH environment variable includes the directory containing the vite executable.

Restart your terminal or command prompt: Sometimes, changes to the PATH environment variable won't take effect until you restart your terminal or command prompt.

Try using the absolute path: If the above steps do not work, try using the absolute path to the vite executable when running the npm run build command. For example

/path/to/vite npm run build
Enter fullscreen mode Exit fullscreen mode

If you're still encountering issues after trying these steps, I recommend checking the Vite documentation or reaching out to the Vite community for more assistance.

Top comments (0)