error TS2304: Cannot find name 'Promise'

后端 未结 2 1760
迷失自我
迷失自我 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.

提交回复
热议问题