1

I am getting errors related to angular when I compile my application. The errors are:

Builds "cannot find @angular/core"

Below is the image of the errors that I am getting:

enter image description here

I am also getting a warning saying:

Your project specifies TypeScript version 2.8, but a matching compiler was not found. The latest available TypeScript compiler will be used (3.7). To remove this warning, install the TypeScript 2.8 SDK or update the TypeScript version in your project's properties.    

In response to the above warning, I changed the properties of the project to point to 3.7 version, but still getting the above listed errors.

Below is the image of the visual studio project properties:

enter image description here

I am still getting the above warning even after selecting 3.7 typescript version from the project properties.I also installed the nuget version 3.7.4 in my project. Below is the image:

enter image description here

Not sure, how to get rid of all the errors that I am getting.

I already spend lot of hours to resolve the issue, but still getting the same errors. I tried to do the ng build in visual studio code and I am getting an error saying:

The build command requires to be run in an Angular project, but a project definition could not be found.

Below is my package.json file

{
  "name": "frontend",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.4",
    "@angular/cdk": "^5.2.1",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/flex-layout": "^5.0.0-beta.14",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^5.2.1",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "ajv": "^6.0.0",
    "angular2-text-mask": "^9.0.0",
    "angular5-time-picker": "^1.0.8",
    "bootstrap": "4.3.1",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "jquery": "^1.9.1",
    "ngx-mask": "^2.9.6",
    "popper.js": "^1.12.9",
    "rxjs": "^5.5.6",
    "text-mask-addons": "^3.7.2",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "1.6.7",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^2.0.4",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.3.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

when I open any .ts file in my application then I get this at the bottom right corner of the visual studio code:

enter image description here

Any help will be greatly appreciated.

Anjali
  • 2,540
  • 7
  • 37
  • 77
  • You.may want to add a `typescript` tag to your question – Flydog57 Mar 22 '20 at 01:59
  • Have you tried installing the TypeScript 2.8 SDK? Do you know where your project specifies TypeScript version 2.8? – Anthony McGrath Mar 22 '20 at 02:08
  • Yes, I tried installing 2.8 SDK, but the errors were still there. I posted my package.json file in my post. I also posted the .ts file bottom Visual studio code screen shot above. That is the problem, I dont know where the project specifies the version 2.8 – Anjali Mar 22 '20 at 02:27
  • In Package.json, it shows 2.5.3 and in the Visual studio code, the typescipt file shows 3.8.3 – Anjali Mar 22 '20 at 02:28
  • About the "matching compiler was not found" warning (not the Angular issue and build errors), I have posted here: https://stackoverflow.com/questions/71126707/ – Thierry_S Feb 15 '22 at 12:53

0 Answers0