I'm trying to install React to start studying and messing around with this library but it gives me an error.
I am following the following steps:
npm install -g create-react-app
create-react-app mi-proyecto
cd mi-proyecto
but when I do npm start
it gives me an error when starting
How can I fix the error so I can successfully install React? I don't know if it is also mandatory to install webpack or Babel for it to work.
Thank you
PS: I have been looking and trying to do some of the solutions that I have seen here, but they have not worked for me and I keep getting the same error
The problem is because there is a folder
node_modules
as the ancestor of this project (and any others you are going to create).This has possibly happened because you have ever run
npm install
(by mistake) out of an application directory and the scripts generated a foldernode_modules
as a result.To fix it, delete the folder
C:\Users\Derek\node_modules
and thepackage.json
(if it exists). Now, you can use:Later:
If you have already created the application, simply run
npm start
.Now it should work without problems.
info about
create-react-app
hereinfo about
npx
here