I was writing JavaScript code (just plain ‘ol web servers because I am a noobie dev) and I got the above error (Refer to title) and I tried every old way I remembered (as I faced the error in the past) but did it work? Nein. And it came to the point where I am now asking this on Stack Overflow, so uh yeah help
What I tried:
I tried like re-opening the file and stuff similar (It resolved the issue for me in the past), I don’t even know if this is detailed enough tbh
>Solution :
Please follow following Steps:
- Delete the node modules folder by running
rm -rf node_modules - Delete package.lock.json file by running
rm -f package-lock.json - Clean up the NPM cache by running
npm cache clean --force - Install all packages again by running
npm install