error TS2304: Cannot find name 'Promise' && TS2307: Cannot find module '**'

error TS2304: Cannot find name 'Promise'

解决方法:在编译选项中加入"target":"es6"

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

 TS2307: Cannot find module '**'
解决方法:在编译选项中加入下列选项

{
  "compilerOptions": {
    "target": "es6",
    "allowJs": true,
    "sourceMap": true,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  }

 

转载于:https://www.cnblogs.com/bldf/p/6388678.html

你可能感兴趣的:(error TS2304: Cannot find name 'Promise' && TS2307: Cannot find module '**')