Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to solve typescript node definition compile errors? [duplicate]

Tags:

typescript

In the node.d.ts file installed by the tsd tool i am getting the following compile error :-

';' expected

for lines that look like :-

read(size?: number): string|Buffer;

the | is underlined as the issue.

how can i fix this?

like image 716
mfc Avatar asked Sep 02 '26 09:09

mfc


1 Answers

how can i fix this?

You are probably using an older version of the TypeScript compiler. | stands for a union type and those came with TypeScript 1.4 and above.

like image 116
basarat Avatar answered Sep 04 '26 00:09

basarat



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!