Reputation: 91
so I tried to run npm start
on my react app.
But It's not running, instead it responds like this:
Can anybody help? In previous projects everything runs fine, and I tried to run other previous projects again that has no .
file in src
folder, it ran well, no problems. Plus, this one also has no .
file in src
folder as well.
I dont know if .
refers to index.js
or any other files, but it clearly has no different when it comes to files contained within src
when initializing npx create-react app ...
or create-react-app ...
.
What I've tried:
node_modules
npm install
npm
versionI hope this information could help in finding solutions, I cant quite see the problem myself, thank you.
Upvotes: 8
Views: 1679
Reputation: 131
According to the git hub issue, they mentioned "your directory path shouldn't have any space" but in my case it still do not work, Once I move to app to Desktop and npm install
and npm start
, It worked fine but I have no idea what was happening under the hood.
Upvotes: 0
Reputation: 11
I face the problem also, and found this link https://github.com/facebook/create-react-app/issues/9902
There mentioned that your directory path shouldn't have any space, since the last react update.
C:\Desktop\React App (BootCamp)\myApp> npm start
After I removed the space from the directory path, it still doesn't works.
C:\Desktop\ReactApp(BootCamp)\myApp> npm start
Then I tried to remove the parenthesis also... and it works.
C:\Desktop\ReactAppFromBootCamp\myApp> npm start
Upvotes: 1
Reputation: 1
I guess this is a problem with the new version of React (it has been updated from 16.13.1 to 17. **. **).
I took from my old file "package.json" " " dependencies ": {" react ":" ^ 16.13.1 "," react-dom ":" ^ 16.13.1 "," react-scripts ":" 3.4. 3 "...}
, removed all files from "src" but did not touch "app.js" and "index.js" and used npm i
& npm start
.
The application started, but I had a problem - there was no "import React from 'react'" in "App.js". check this option.
Upvotes: 0
Reputation: 1
I have the same problem when I created a new app recently using create-react-app tool. Maybe the problem is the path of the folder which includes the react app is too long, or some special characters in the path. When I put my app into a new folder which has a short and simple path, it works. A new problem caused by new updates.
Upvotes: 0
Reputation: 91
anyway..
I tried to move around this new react app folder to any path that doesn't contain archive
in its directory, it runs well (even though its parent folders has space in its name).
But, my previous projects are located inside a path which contains archive
, it runs fine too, so I'm not sure if these are due to the latest changes React made or something in that nature.. but at least it runs now and I can continue building my portfolio.
Hope this runs on your machine too :)
Upvotes: 0
Reputation: 183
Having the same problem... it happens to me when I run create-react-app in a particular folder. it doesn't happens when I run it a in a new directory.. still trying to figure it out.
Upvotes: 0
Reputation: 1
It's very weird, I had the same issue with a new project I created and there is no way to make it work. The solution for me was to copy all the files from a working project (instead of creating a new react app) and then it ran fine.
Upvotes: 0
Reputation: 669
I've had the same issue after I deleted everything in the src
dir and all I had to do to fix the problem was to stop the server with ctrl+c
and then npm start
.
Upvotes: 0