I\'m getting following Console Error.
Error : Cannot find module
Here is the full error i\'m getting in console. What should I do?
What helped me was to place the .js file that I was working with in a new folder, drag and drop that folder into VS Code (to open the directory directly in VS Code), open the terminal in VS Code, and then simply type node (or in my case node index.js).
I had already installed node on my system, but for whatever reason, I was still getting the error that you've mentioned, even when I typed the direct path to the file i.e. node /desktop/index.js.
So, creating a new folder on my desktop, placing the .js file inside that folder, opening that folder within VS Code, and then typing node index.js in the terminal solved my issue.