0

Hi I just started a course on udemy in order to learn JS and react in the program after installing node and npm we should use npm start but it keeps giving me this ERR which I couldn't find any clue about what should I do.

D:\Private\Projects\JS>npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\Private\Projects\JS\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\Private\Projects\JS\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\Navid\AppData\Roaming\npm-cache\_logs\2020-08-27T23_15_42_286Z-debug.log

D:\Private\Projects\JS>

and if you know any good course or ways to start learning JS and react native It will be appreciated

navidabasi
  • 161
  • 1
  • 10
  • 1
    `package.json` not found in your project, If it's a fresh project, You need to initiate using `npm init` command. – BadPiggie Aug 28 '20 at 11:54
  • @stvn well I actually searched for this: npm ERR! code ENOENT thanks btw for sharing the link into the problem – navidabasi Aug 28 '20 at 18:44
  • @navidabasi I deleted my original comment as it was pointing to a confusing answer. The one that was the actual duplicate of your issue was https://stackoverflow.com/questions/9484829/npm-cant-find-package-json. Make sure you always search for issues without adding you local machine details. Search engines will try to search too specific and will not even bring up answers to very simple questions. Good luck. – stvn Aug 28 '20 at 19:02

1 Answers1

1

This error normally occurs when you use npm start in wrong folder. Check if you are in the same folder as you package.json file.

If you don't have a package.json file yet you do need to initiate the project by using

npm init -y

You need to make sure you are in the right folder either way.

  • shout out for Mara and BadPiggie for helping to solve this problem thanks ran into a new one ``` npm ERR! missing script: start ``` gonna search for it but any help would be appreciated in advance <3 – navidabasi Aug 28 '20 at 18:39
  • @navidabasi you need to make sure you actually have a "start" script in your package.json script section. The issue is already documented on here - https://stackoverflow.com/questions/31976722/start-script-missing-error-when-running-npm-start - I would strongly suggest to go through the basic documentation of npm though, it will save you a lot of headache. – stvn Aug 28 '20 at 18:58
  • @stvn yea thanks stvn , found out that I was not in the expected folder in my terminal already fixed it thanks and I will read the documentation since you recommend – navidabasi Aug 28 '20 at 19:18