Accessors are only available when targeting ECMAScript 5 and higher

前端 未结 14 1667
北荒
北荒 2020-12-23 13:07

I am trying to run this code but it is giving me following errors:

Animal.ts(10,13): error TS1056: Accessors are only available when targeting ECMAS

14条回答
  •  抹茶落季
    2020-12-23 13:42

    The only thing which worked for me was to specify the Target on macOS and Windows. Please note the parameter -t is standing for Target.

    tsc -t es5 script.ts
    

    You can run the command on your terminal.

提交回复
热议问题