I'm trying to understand why this line invokes an error:
const value = 20 * 30;
error TS1008: Unexpected token; 'module, class, interface, enum, import or statement' expected.
any idea?
Here is the solution:
Earlier on my machine I had installed Visual Studio 2015 Pro Edition. that had installed TypeScript 1.0.3.0. and added its path to system environment.
Now I used npm install -g TypeScript
and it did install, however from command line, typing tsc --version
was always giving 1.0.3.0.
I removed the older path from environment and then restarted code and it worked fine.
Better you check your versions and the solution might help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With