Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does VS Code throw "Cannot find module 'typescript'. ts(2307)" while the module is there?

I'm using import * as ts from "typescript"; to import typescript in a .ts file.

The file runs fine, but VS Code is telling me Cannot find module 'typescript'. ts(2307).

Is there any way to suppress this problem?

Edit: the file can be compiled and run successfully

like image 880
Tom Avatar asked Aug 31 '26 11:08

Tom


1 Answers

You want to change these two settings in VS Code's settings.json:

"typescript.validate.enable": false,
"javascript.validate.enable": false,

Source

like image 148
Saddy Avatar answered Sep 03 '26 00:09

Saddy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!