Home > Net >  npm start not working in the react app, what do i do?
npm start not working in the react app, what do i do?

Time:12-03

So i created a react app when and I did npm start for the first time, the app opened in the browser, no issues. Subsequently I closed the tab & the VSC editor. Now that i try "npm start" again in the VSC terminal, the app doesnt open and I get a strange response. This is my first proper question on Stackoverflow and first project on React please be kind to me.

After making the app using create-react-app my-app and doing npm start and the project running well. Now when i do npm start this happens:

PS C:\Users\Lenovo\Desktop\Coding\React\Practice> npm start

npm ERR! code ENOENT

npm ERR! syscall open

npm ERR! path 

C:\Users\Lenovo\Desktop\Coding\React\Practice/package.json

npm ERR! errno -4058

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Lenovo\Desktop\Coding\React\Practice\package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

Except npm help, no other command runs. Please help me out.

CodePudding user response:

npx create-react-app practice-app

cd practice-app

/practice-app/ npm start

You have to be inside the react application you have created to launch the application with npm or yarn. I think you were still on the parent folder which in this case is the Practice folder.

On vscode terminal type cd then press the tab button u will see all the folders contained inside the Practice folder coming up. keep pressing till your react project folder comes to the screen and press enter.

Then type code . to open the folder on vscode ide. Then use npm start or yarn start on the project to start.

  • Related