TypeScript error TS1005: ';' expected (II)

后端 未结 9 1100
旧巷少年郎
旧巷少年郎 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:37

    Your installation is wrong; you are using a very old compiler version (1.0.3.0).

    tsc --version should return a version of 2.5.2.

    Check where that old compiler is located using: which tsc (or where tsc) and remove it.

    Try uninstalling the "global" typescript

    npm uninstall -g typescript
    

    Installing as part of a local dev dependency of your project

    npm install typescript --save-dev
    

    Execute it from the root of your project

    ./node_modules/.bin/tsc
    

提交回复
热议问题