While compiling in Task Run Explorer, I encountered an error from gulp that took me by surprise since I didn't make any changes. Despite searching online for solutions, none of them seemed to work.
ERROR 1
... node_modules/@angular/common/src/facade/lang.d.ts(11,17): error TS2304: Cannot find name 'Map'. node_modules/@angular/common/src/facade/lang.d.ts(12,17): error TS2304: Cannot find name 'Set'. node_modules/@angular/common/src/pipes/async_pipe.d.ts(41,38): error TS2304: Cannot find name 'Promise'. ...
This is my tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "system",
"moduleResolution": "node",
"noImplicitAny": false,
"noEmitOnError": false,
"removeComments": false,
"target": "es5"
},
"exclude": [
"node_modules",
"wwwroot"
]
}
Here is my package.json:
{
"version": "1.0.0",
"name": "testapp.web",
"private": true,
"dependencies": {
"@angular/common": "2.0.0-rc.5",
...
},
"devDependencies": {
"gulp": "^3.9.1",
...
},
"scripts": {
"postinstall": "typings install dt~core-js --global"
}
}
Modified with the solution found:
New tsconfig.json:
{
...
**"target": "es6" <<-- CHANGE**
...
}
New package.json:
{
...
**"es6-promise": "3.2.1",
"es6-shim": "0.35.1"**
...
}
I now encounter this error:
GulpUglifyError: unable to minify JavaScript
If I implement the second solution, will it cause compatibility issues with older browsers?