TypeScript error TS1005: ';' expected (II)

后端 未结 9 1078
旧巷少年郎
旧巷少年郎 2020-12-09 02:11

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

9条回答
  •  既然无缘
    2020-12-09 02:54

    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.

提交回复
热议问题