Creating react app

Hello everyone,

When i do npm run dev i get below error:

MuhammadBilal@Muhammads-MacBook-Air react-app % npm run dev

react-app@0.0.0 dev


sh: vite: command not found

MuhammadBilal@Muhammads-MacBook-Air react-app %

I have tried everything but its not working.

Any help will be appreciated.


Hey there,

if you are trying to create a react app there are several tools for it.

The easiest in my opinion is using Vite.
You could opt for a preconfigured git repository to make things a little more streamlined.
For example this:
or this:

Clone one of these repositories from Github. Navigate to the directory you pulled to in your console and run:
npm init
npm install
Then run
npm run dev

To start a new project from scratch you would use this command:
npm create vite@latest
To tell vite that you would like a specific template use this command:
npm create vite@latest my-react-app -- --template react-ts

You can find more information on possible configurations here:

Thanks a lot, really appreciate it.

1 Like