Search code examples
javascriptnode.jsreactjsnpmvite

Issue with creating a react app from vite


I tried to create a react app using this command

npm create vite@latest filemanager

and then when i tried to run

npm run

i get this error

> [email protected] dev
> vite

sh: 1: vite: not found

I tried using npm install after deleting node_modules dir and package-lock.json

Still issue is the same.

I even tried to uninstall and reinstall node

still that doesn't change anything

I am kinda newbie with these js stuffs i am not sure of the terms or most of the process. Can someone help me out.

I am using ubuntu 22

and node version 20.5

I expect this to start the react app successfully.

My assumption is that npm appears to not be able to detect runnable programs in node_modules

Not sure i know how to fix it


Solution

  • You need to install vite first. Hence first run:

    npm i -g vite
    

    Then create your vite app by:

    npm create vite@latest filemanager