Reputation: 157
I'm taking my first steps into TypeScript and discovered let
keyword, which I found very helpful.
However, TypeScript compiler throws error TS1005: ';' expected.
when trying to compile the following code:
let one = 1;
The command I use to compile is $ tsc file.tsc
Any help you can provide will be great!
Upvotes: 4
Views: 4773
Reputation: 275867
You are using a really really old version of TypeScript (at least in TypeScript term of long) e.g. 1.0.1
will give that error as it does not understand let
:
Please use a newer TypeScript version such as 1.8
Upvotes: 5
Reputation: 1
Follow this thread on stackoverflow to update the typescript and point to the right version in PATH. I faced the same issue even after updating the typescript because I had another version installed by Visual studio. And PATH was pointing to that old version like below.
Open Cmd and do 'where tsc' , which shows the list of typescripts in the path then you can manually delete the typescript paths outside of nodejs. Credits - evilinside
Upvotes: 0
Reputation: 23
There was Environment path to Typescript 1.0 from Windows SDK on my machine. Removing that will solve this issue in VS Code terminal.
Upvotes: 0