Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find 'node_modules/typescript/lib/lib.d.ts' in tsconfig file

Tags:

tsconfig

After I update a package , I saw this error( meanwhile I updated my vs code ) / I dont know how to fix this error, appreciate it if anyone helps me out in this case to handle this error

  File 'c:/Program Files/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/lib.d.ts' not found.
    The file is in the program because:
    Default library for target 'es5'
like image 820
Mojtaba Sedighi Avatar asked Sep 01 '25 10:09

Mojtaba Sedighi


2 Answers

This happened to me right after I've updated my VS Code today. Restarting TypeScript server didn't help. So I've found the answer here.

To 'fix' it, I had to:

  1. Install the JavaScript and TypeScript Nightly VS Code extension.
  2. Open any TypeScript file.
  3. Open command pallete (ctrl+p) and type: >Typescript: Select TypeScript Version
  4. Select the VS Code version.

I hope it helps.

like image 148
R. B. Westphalen Avatar answered Sep 10 '25 19:09

R. B. Westphalen


Restarting the TS server in Visual Studio Code did the trick for me as described here:

CMD+SHIFT+P (or CTRL-SHIFT+P) ->

enter image description here

like image 28
Gorgsenegger Avatar answered Sep 10 '25 19:09

Gorgsenegger