First of all, I\'ve already seen the other posts about error TS1005. Same error code, but totally different.
A simple let x: number;
will gener
I was injecting service like this:
private messageShowService MessageShowService
instead of:
private messageShowService: MessageShowService
and that was the reason of error, despite nothing related with ','
was there.
You haven't the last version of typescript.
Running :
npm install -g typescript
npm
checks if tsc
command is already installed.
And it might be, by another software like Visual Studio
. If so, npm
doesn't override it. So you have to remove the previous deprecated tsc
installed command.
Run where tsc
to know its bin location. It should be in C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
in windows. Once found, delete the folder, and re-run npm install -g typescript
. This should now install the last version of typescript.
On Windows you can have in your PATH
PATH = ...;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\; ...
remove it from PATH env, then
npm install -g typescript@latest
it worked for me to solve the
"TypeScript error TS1005: ';' expected"
See also how to update TypeScript to latest version with npm?