"npm start" is causing error - ENOENT: no such file or directory ... package.json [closed]
Asked Answered
O

3

5

I tried to create a React app using NPX. Everything went well, but when I run npm start, I get the following error:

$ npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\Administrateur.TEST\Desktop\reactProjects\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Administrateur.TEST\Desktop\reactProjects\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\Administrateur.TEST\AppData\Roaming\npm-cache\_logs\2020-07-19T22_43_34_181Z-debug.log
Outfox answered 19/7, 2020 at 22:54 Comment(1)
Are you inside the project directory?Donyadoodad
C
12

while running npm start make sure that your terminal opened in which directory where package.json is present

Chesson answered 28/12, 2020 at 5:20 Comment(0)
S
2

Ciao, you have to launch npm init before npm start to create your missing package.json file.

Salisbury answered 19/7, 2020 at 22:59 Comment(0)
V
1

npx create-react-app my-app will create a directory called my-app (which contains the app).

To use the app, you'll need to navigate to the new directory: cd my-app.

Once inside the directory, you can run npm start to start the app.

Varela answered 19/7, 2020 at 23:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.