vmg
vmg

Reputation: 10566

Compilation error when using node.d.ts in TypeScript file

I am working on my first node.js project (for learning purposes) and I would like to use TypeScript as language of choice together with Visual Studio Code (yeah, I'm not looking for easy ways). Source code is here: https://github.com/thecoderok/ukrbash-node When I reference node.d.ts in the source code I am getting lots of compilation

errors like:urkbash-node\typings\node\node.d.ts(178,36): error TS1005: ';' expected. urkbash-node\typings\node\node.d.ts(425,5): error TS1008: Unexpected token; 'module, class, interface, enum, import or statement' expected. urkbash-node\typings\node\node.d.ts(425,12): error TS1008: Unexpected token; 'module, class, interface, enum, import or statement' expected. urkbash-node\typings\node\node.d.ts(425,17): error TS1005: ';' expected.

Does anyone know why and how to fix it?

Upvotes: 1

Views: 1332

Answers (1)

basarat
basarat

Reputation: 276189

errors like:urkbash-node\typings\node\node.d.ts(178,36): error TS1005: ';' expected.

Considering the content of the line here Seems like you are using it with TypeScript 1.4 (which doesn't have union types). Please update VS Code to latest to use TS 1.5

Upvotes: 1

Related Questions