-1

Hello community I have a base project that I want to update to the latest version that I have installed globally (8.00) The base project that I try to update seems to be in Angular 4 and Angular Cli 1.0.0

When I run ng serve I get

Your global Angular CLI version (8.3.5) is greater than your local
version (1.7.4). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

I tried to follow the steps of several posts, but without success : updateAngular , updateAngular2

Project to updatee

package.js:

"dependencies": {
    "@angular/animations": "^4.0.1",
    "@angular/common": "^4.0.1",
    "@angular/compiler": "^4.0.1",
    "@angular/compiler-cli": "^4.0.1",
    "@angular/core": "^4.0.1",
    "@angular/forms": "^4.0.1",
    "@angular/http": "^4.0.1",
    "@angular/platform-browser": "^4.0.1",
    "@angular/platform-browser-dynamic": "^4.0.1",
    "@angular/platform-server": "^4.0.1",
    "@angular/router": "^4.0.1",
    "animate.css": "3.1.1",
    "bootstrap": "^3.3.7",
    "chart.js": "^2.5.0",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "jquery": "^3.1.0",
    "jquery-slimscroll": "^1.3.8",
    "jquery-sparkline": "^2.4.0",
    "jvectormap": "1.2.2",
    "metismenu": "^2.5.0",
    "ng2-charts": "^1.5.0",
    "ngx-bootstrap": "^1.6.6",
    "peity": "^3.2.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "^1.0.0",
    "@angular/compiler-cli": "^2.4.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0",
    "typescript": "~2.1.5"
  }

structure :

enter image description here

Angular Cli G

enter image description here

I look forward to any suggestions, thanks

UPDATE

 "devDependencies": {
    "@angular/cli": "^1.0.0",}

Run ng update @angular/cli Error : Repository is not clean. Please commit or stash any changes before updating.

Then run

ng update @angular/cli @angular/core --allow-dirty  

Error : enter image description here

  • 1
    What you posted is just a warning. Can you please specify what does not work? Does the application not compile or not start up? Can you post the error please? – dave0688 Oct 17 '19 at 14:31
  • @dave0688 I have no compilation errors, what I want is to follow the update suggestion so as not to have future problems, if I am not so specific please edit my question if you think it is convenient, thanks – Danna Luciana Carrillo Perez Oct 17 '19 at 14:38
  • So please try with `ng update`. It shows you what you need to update, and it will also migrate your project and correct the breaking changes. – dave0688 Oct 17 '19 at 14:40
  • this is a complete guide to upgrade from 7 to 8 : https://stackoverflow.com/questions/58393210/upgrade-angular-from-7-to-8/58393752#58393752 – Abolfazl Roshanzamir Oct 17 '19 at 15:06

1 Answers1

2

Update your dev dependency for the @angular/cli. It's telling you the versions do not match.

 "devDependencies": {
    "@angular/cli": "^1.0.0",
  ...
  }

You should let the angular upgrade handle this update:

ng update @angular/cli

This should help you get where you need to be: Angular 6 Migration -.angular-cli.json to angular.json

Also an update guide: https://update.angular.io/#4.0:8.0

Damian C
  • 2,111
  • 2
  • 15
  • 17
  • After following your suggestion, run ng serve: "The serve command requires to be run in an Angular project, but a project definition could not be found." , I think it is related to angular angular-cli.js – Danna Luciana Carrillo Perez Oct 17 '19 at 14:48
  • I've updated my answer and provided a link that should help you with this process. – Damian C Oct 17 '19 at 14:52
  • update my question following the steps of your suggestion – Danna Luciana Carrillo Perez Oct 17 '19 at 15:03
  • I am following the official manual, and when executing ng update @ angular / cli, I get the error: Package @ angular / core would need to match both versions "7.2.15" and "8.2.11, which are not compatible. I'm about to give up – Danna Luciana Carrillo Perez Oct 17 '19 at 17:47
  • Just a thought. How large is your project? If it isn't large it might be easier to start a brand new angular project and just copy your src into that. I don't think you'll have that many breaking changes, unless its a large project. – Damian C Oct 17 '19 at 17:57
  • It's just a base project, I haven't implemented anything yet, the project is a template that is in git : https://github.com/Chuibility/inspinia/tree/master/Angular_4_Seed_Project – Danna Luciana Carrillo Perez Oct 17 '19 at 18:33
  • In that case I think you'll save yourself a big headache by just creating a new angular 8 project. It scaffolds it all for you so all you have to do is start building your app. – Damian C Oct 17 '19 at 19:32