I am trying to set up react app using create-react-app command on windows pc. I already used it on my mac computer, and it works well. But I encounter a problem. Here my ste
If above solution not working try this on it will work 100%
0)first of all install package "npm create-create-app -g" or "yarn add create-react-app" then
1)open cmd and type "npm root -g" this command will give you path of node_model directory for global packages
2) copy that path only upto npm directory eg.C:\Users\vchaudhari\AppData\Roaming\npm
3) open environmental variables in windows and pest that command in that save it .
4) close current cmd and open new cmd and use command "create-react-app demoapp"
5) Enjoy :-)
I solved the problem by uninstalling create-react-app:
npm uninstall create-react-app
then install with the following command:
npm install -g create-react-app
I'm adding this because this pops up on Google and I was having trouble.
I'm on Windows 10 and I searched for 'create-react-app' in C:\
and the path was C:\Users\Admin\AppData\Roaming\npm\node_modules
.
I added that to the Environment Variables > Path and the command works now.
Do the following from TERMINAL
:
cd myReactApp
npx create-react-app .
This should work!
For me just create-react-app project-name
worked after adding path C:\Users\user\AppData\Roaming\npm\node_modules
to my environment variables.
Try with this npx create-react-app my-app