#Typescript installs fine but dosent work in vscode

8 messages · Page 1 of 1 (latest)

near pendant
#

I installed typescript on a new machine, and it seems like it installs fine, but I am still not able to use any of the features in vscode.

I follow the docs and install with npm install -g typescript
I get no errors.
ok.

I check it installed fine with tsc -v
It returns the latest version: Version 4.9.5
ok.

and just to be 100% sure its installed I use npm list -g --depth 0
and get returned:
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
ok.

I create a .ts file and write test code (attached screenshot shows no syntax errors)

let test: string = "brah";

test = 6;

console.log(test);

no syntax errors.

I can convert the file to js and it runs fine, and I can run the ts file and I get the right error variableMe.ts:3:1 - error TS2322: Type 'number' is not assignable to type 'string'., but there is no syntax highlighting/errors.

It might be something in my vscode settings but I dont know where to look. Also I have not installed any ts extensions that could be messing with it.

any advice helps. thanks.

lavish mulch
#

have you installed/enabled the ts extension?
have you opened it as a project (folder) rather than a file?

near pendant
lavish mulch
#

typescript, it's one of the builtins

#

you may have disabled it?

#

these, i suppose

near pendant
#

yep that was it