My TypeScript project is building and running, but I'm encountering a multitude of build errors all originating from one issue:
TS4090: (TS) Conflicting definitions for 'node' found at 'C:/[projectpath]/node_modules/@types/node/index.d.ts' and 'C:/[user path to Microsoft]/Typescript/3.1/node_modules/@types/node/index.d.ts'. Consider installing a specific version of this library to resolve the conflict.
I'm confused about the suggestion to "install a specific version of this library." I don't understand why two versions are being detected in the first place.
The tsconfig.json
file for my app is located in the ClientApp
directory and looks like this:
{
"compileOnSave": false,
"compilerOptions": {
"module": "esnext",
"skipLibCheck": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"target": "es2015",
"lib": [
"es2016",
"es2017",
"dom"
],
"moduleResolution": "node",
"allowJs": true,
"baseUrl": "src"
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"./custom_typings/**/*.d.ts"
],
"atom": {
"rewriteTsconfig": false
},
"typeAcquisition": {"enable": false}
}
I recently added the typeAcquisition
section based on suggestions from other discussions related to this problem, but it didn't make any difference.
How can I go about "installing a specific version of this library" as suggested?
Environment
This project is targeting .NetCore 2.2 with WebAPI Controllers serving backend data and a ClientApp directory containing an Aurelia-based SPA UI that is built using WebPack.
Errors