r/learnreactjs • u/idontthinkipeeenough • Oct 28 '22
Why is my terminal saying I can’t create a react app ?? Help!!
Basically, the terminal thought the "." was the name of the file, so i typed in npx create react-app react-app and after a bit, this is what i got.
when npm start is run, it produces an error.
My node.js up to date. Can anyone help? I’ve been to stack overflow everything leads to the same results or errors
0
Upvotes
7
u/MantusTMD Oct 28 '22
It tells you what to do right in the terminal. You have to update it
2
u/ataisim Oct 28 '22
I've just had the same problem, try deleting the node.js and installing the latest version. Also, check this one out https://sebhastian.com/npm-err-enoent/
2
u/Smartercow Oct 28 '22
You have to run
first-react-appis the folder the project gonna be installed or if you already in that folder just use dot instead of folder name:You can't just run
create-react-app1
u/cbadger85 Oct 28 '22
What command are you running? What version of node are you using?
1
u/TacoDelMorte Oct 28 '22
I strongly suggest using Vite instead of create-react-app. It’s probably faster for you to Google search why it’s better rather than have me write it all out here. https://vitejs.dev
npm create vite@latest my-app-name —template reactThat being said, try this:
npm config set legacy-peer-deps truethen
npm create-react-app my-appThis will bypass installing peer dependencies and install anyway. Not guaranteed to work but typically does.
1
u/Eating_Bagels Oct 28 '22
When you ran the command you tried and it doesn’t work, try running the same command again, except add “sudo”. Ie it should look like “$sudo npm uninstall -g create-react-app” and then run again “$sudo npm install -g create-react-app”.
If I had learned this earlier on, I would have saved many hours. Good luck!
1
u/[deleted] Oct 28 '22
It looks like your package.json is in “first-react-app/react-app”, whereas you are running command from “first-react-app”.
1
u/kjempion Oct 28 '22
Why dont you read?
-2
u/idontthinkipeeenough Oct 28 '22
Basically where’s the templates!!