1

I am a newbie in react js.When i want to create-react-app-todos-list it is creating but not displaying success message. As a result when i use npm start command it is displaying error.So please help me to fix this error.

//When i am using create-react-app todos-list it is displaying the following in vscode

 npx create-react-app todos-list

Creating a new React app in D:\react\todos-list.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

added 1357 packages in 1m

166 packages are looking for funding
  run `npm fund` for details

//When i am using npm start command it is displaying as like this

PS D:\react> npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\react/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\react\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shaik\AppData\Local\npm-cache\_logs\2022-01-14T14_29_47_642Z-debug.log
PS D:\react>

**Solutions I tried

For create-react-app**
npm uninstall -g create-react-app && npm i -g npm@latest && npm cache clean -f 
and SKIP_PREFLIGHT_CHECK=true
4
  • What do you have in your package.json? Commented Jan 14, 2022 at 14:41
  • 1
    Make sure you are executing npm from the directory that your package.json is located. What is in your package.json? Commented Jan 14, 2022 at 14:43
  • I'm going to bet you do NOT have a package.json file in that dir, for whatever reason. Commented Jan 14, 2022 at 14:46
  • npm start should be run inside todos-list folder. D:\react\todos-list> npm start Commented Jan 14, 2022 at 15:00

2 Answers 2

1

You are not inside todos-list directory: PS D:\react>

Type: cd todos-list then npm start

Sign up to request clarification or add additional context in comments.

1 Comment

@Naheedaparveen Try uninstall & reinstall nodejs before that remove path from environment variable.
0

When you create react app with npx create-react-app you have option to name your project like what you are done npx create-react-app todos-list and another option which is to create the app in the current directory npx create-react-app .

The problem in your case comes from that you named your project and now you have to explicitly navigate to the dir of the project because the package.json is in that dir. The package.json is essential because it contains all the necesary scripts to run your app.

If you are on the same console you need to just type:

cd todos-list

and then:

npm start

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.