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

时间:2021-01-24 19:49:57

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
}