I recently installed VisualStudio 2017 on my computer and have encountered an issue with typescript compilation. I am struggling to find a solution to this problem, as the same errors were present in VS2015 as well. Currently, I have globally installed [email protected].
Below is my typings.json file:
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160725163759",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160909174046"
}
}
Here is my tsconfig.json file:
{
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules"
]
}
The following are the error logs from VisualStudio:
2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(569,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Number'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(599,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Math'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(619,11): error TS2451: Build:Cannot redeclare block-scoped variable 'RegExp'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(623,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Map'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(624,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Set'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(625,11): error TS2451: Build:Cannot redeclare block-scoped variable 'WeakMap'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(626,11): error TS2451: Build:Cannot redeclare block-scoped variable 'WeakSet'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(627,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Promise'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(628,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Symbol'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(629,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Dict'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(630,11): error TS2451: Build:Cannot redeclare block-scoped variable 'global'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(631,11): error TS2451: Build:Cannot redeclare block-scoped variable 'log'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(632,11): error TS2451: Build:Cannot redeclare block-scoped variable '_'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(661,5): error TS2300: Build:Duplicate identifier 'export='.