Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular not working after cloning to a different PC

so I got a new pc and I wanted to pass my angular project through github. I used 1.npm i 2.npm i @angular/cli@latest -D 3. ng update

And Everytime I'm trying to run the project with ng s it keeps sending me this error:

This version of CLI is only compatible with Angular versions ^9.0.0-beta || >=9.0.0 <10.0.0,
but Angular version 8.2.14 was found instead.

Please visit the link below to find instructions on how to update Angular.
https://angular-update-guide.firebaseapp.com/

I tried using the instructions at the link.

This is my Angular version when typing ng --version:

Angular CLI: 9.0.1
Node: 12.16.0

This is the package.json:

{
  "name": "empire-gaming",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular-redux/store": "^10.0.0",
    "@angular/animations": "~8.2.14",
    "@angular/cdk": "~8.2.3",
    "@angular/common": "~8.2.14",
    "@angular/compiler": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@ng-bootstrap/ng-bootstrap": "^5.2.1",
    "@ngrx/store": "^8.6.0",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "hammerjs": "^2.0.8",
    "mongoose": "^5.8.10",
    "ngx-bootstrap": "^5.3.2",
    "redux": "^4.0.5",
    "rxjs": "~6.4.0",
    "tslib": "^1.10.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.22",
    "@angular/cli": "^9.0.1",
    "@angular/compiler-cli": "~8.2.14",
    "@angular/language-service": "~8.2.14",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.5.3"
  }
}

I'm really clueless about it... I would be glad if you help me.

like image 946
SahiBalata Avatar asked Feb 12 '20 14:02

SahiBalata


1 Answers

The version of Angular that you are using in the project is lower than the version that needed for the latest version of Angular CLI. I would recommend you to downgrade the Angular CLI version to 8.3.25

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/[email protected]

And change the version of Angular CLI in your devDependencies:

npm install -D @angular/[email protected] 
like image 159
Maksym Bezruchko Avatar answered Oct 23 '22 11:10

Maksym Bezruchko