Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to fix "cannot find module {the path to my folder}" when using javascript code (im running it using node .)

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading