error TS2304: Cannot find name 'Promise'

后端 未结 2 1740
迷失自我
迷失自我 2020-12-30 02:15

Hello guys I went through all solution avaialble on stackoverflow. But none of work for me. Hence posting question. tsconfig.json

{
  \"vers         


        
相关标签:
2条回答
  • 2020-12-30 02:51

    You just need to change your target to es6 inside your tsconfig.json to resolve this issue.

    {
      "version":"2.13.0",
      "compilerOptions": {
        "target": "es6", //<- change here
        ......
      },
      "exclude": [
            "node_modules"
        ]
    }
    

    Other way what you can do is, you need to make sure you have es6-shim.js have been referred there on page and then follow this answer that would not need to change target option.

    0 讨论(0)
  • 2020-12-30 03:00

    Since it is "TS errors" i suggest you should install es6-promise typings. You can do it with at your project root with typings install dt~es6-promise --global --save

    0 讨论(0)
提交回复
热议问题