TS2304 Cannot find name 'Map', 'Set', 'Promise'

来源:互联网 发布:网络诈骗钱能追回吗 编辑:程序博客网 时间:2024/04/29 14:37

此问题解决地址

解决地址:https://stackoverflow.com/questions/39416691/webpack-ts2304-cannot-find-name-map-set-promise

原因

由于Map和Setes6的特性,之前我的tsconfig.json设置的"target" : "es5"导致不能引入新的特性,因此需要更换为"target" : "es6"再执行就Ok了

{  "compilerOptions": {    "target": "es6",    "sourceMap": true,    "experimentalDecorators": true,    "emitDecoratorMetadata": true,    "module": "system",    "moduleResolution": "node",    // <-----    "noImplicitAny": false    //    "outDir": "../../templates/build",    //    "rootDir": "../../templates/script"  }  //  "exclude": [  //    "node_modules",  //    "typings/main",  //    "typings/main.d.ts"  //  ]    ,    "include": ["./script/**/*"]    ,    "exclude": ["node_modules","js"]}
阅读全文
0 0
原创粉丝点击