VSCode jsconfig.json error "node_modules/agent-base/dist/src/index" not found

Viewed 11551

Why is VSCode showing this error?

It's just a jsconfig.json file.

NOTE: I'm not using TypeScript.

enter image description here

5 Answers

Try adding "exclude": ["node_modules"] as described in the VSCode docs.

I added this and restarted VSCode and the error message went away.

Disabling typescript in the workspace options seems to be the one thing that stopped this warning for me:

"typescript.validate.enable": false,

I was facing the issue in Vuejs/Nuxtjs project:

  1. Check the jsconfig.json file in root and include the following things if not available already: "exclude": ["node_modules"]
{
    "compilerOptions": {
      "target": "es6",
      "baseUrl": "."
    },
    "exclude": ["node_modules"]
  }
  

Important

  1. If you are getting the error even after having these values then you SHOULD RESTART vs code application

Add "exclude": [ "node_modules/**/*", ], in the tsconfig.json file and if it still doesn't work, try reloading the VSCode by pressing Crtl + Shift + P and Reload Window and it should work.

I also had some issues like this while using node modules. I just recreated the project copied and pasted all the code that i needed and installed every node modules after that i was able to fix the issue. However i dont recommend for large projects.

Related