As a newcomer to the world of coding, I've found that asking questions on platforms like Stack Overflow enables me to connect with fellow developers.
I usually code using VS Code and rely on the "live server" extension to quickly test my code. However, when attempting to start a simple HTML/CSS/JS project recently, I encountered the following error:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\.\..\...\....\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\.\..\...\....\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
After some investigation, I learned that running npm install
or npm init
might resolve the issue.
Unfortunately, neither solution fixed the problem. Even after creating the package.json
file through npm init
, the issue persisted.
Furthermore, setting up the "start" script as required by npm init
did not solve the issue either.
I have already tried:
- Deleting all .json files and running npm install.
- Running npm init and adding the "start" script.
- Rebooting my computer.
- Uninstalling and reinstalling VS Code.
- Recreating the entire project on another computer.
Despite these efforts, I remain stuck on this issue and unsure of what steps to take next.