Currently, I am facing an issue while trying to run tsc in my Angular 2 application directory. The error message I receive is:
Error TS5023: Unknown compiler option 'moduleResolution'.
This issue seems to be hindering the startup process, as tsc is linked to the npm start script. My codebase is based on the Angular 2 quickstart template. Despite numerous attempts and research, I have been unable to resolve this issue. Any help or guidance would be greatly appreciated.
UPDATES
I have included my tsconfig.json configuration below. Upon investigation, I discovered that my tsc version was outdated (1.5.3). To address this, I executed the command npm install -g typescript
to update the global tsc version. However, even after updating, the same error persisted when running tsc in the directory. In order to address this, I ran npm install typescript
within the project directory. Could this discrepancy be due to an older version overriding the globally installed one?
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
}
}