How do I resolve the VSC error "ENOENT: no such file or directory"?

2.1k Views Asked by At

I am trying to run a code in Visual Studio Code, but I am getting this error in my debug console: Could not read source map for file:///C:/Users/####/OneDrive/Documents/Programming/Softwares/JavaScript/jspsych-6.3.1/examples/js/webgazer/webgazer.js: ENOENT: no such file or directory, open 'c:\Users####\OneDrive\Documents\Programming\Softwares\JavaScript\jspsych-6.3.1\examples\js\webgazer\webgazer.js.map'

I do not know what that error means. I know that other people in the stackoverflow community have already asked about it, but I am such a novice programmer that I cannot understand discussions that do not apply to my own codes. Based on what I read in previous discussions, I think my code might be failing because the folder I am accessing does not have a .map file. Unfortunately, I do not know what a .map file is, let alone how to create one!

Would someone please explain what the "ENOENT: no such file or directory" error means, and how I could resolve it? If resolving the issue would require creating a .map file, would you also please explain how to do that?

1

There are 1 best solutions below

0
On

To me it seems you copied some code from a example which uses the file which you are missing, but im just guessing. I would say get the missing file from where you got the copied code or from the library you are using (webgazer) alternatively you could disable source mapping entirely in your settings.

Another Idea: Here they are saying the file gets (only) installed if you install the library with a packagemanager like npm or yarn. But they also say you could download the file from a old commit from the webgazer git repositorie

Here is a solved question with a similar problem and good ideas