1

I had to upgrade from angular 5.2 to 7.2, following these instructions: https://update.angular.io/#5.2:7.2l2

I ended with this package.json:

{
"name": "my-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^9.0.1",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "^9.0.1",
    "@angular/compiler": "^9.0.1",
    "@angular/core": "^9.0.1",
    "@angular/forms": "^9.0.1",
    "@angular/http": "^5.2.4",
    "@angular/material": "^7.3.7",
    "@angular/platform-browser": "^9.0.1",
    "@angular/platform-browser-dynamic": "^9.0.1",
    "@angular/router": "^9.0.1",
    "@ng-idle/core": "^2.0.0-beta.15",
    "@ng-idle/keepalive": "^2.0.0-beta.15",
    "angular-tree-component": "^7.1.0",
    "angular2-moment": "^1.9.0",
    "bootstrap": "^4.0.0",
    "bootstrap-auto-dismiss-alert": "^1.0.2",
    "browser-module": "0.0.1",
    "core-js": "^2.4.1",
    "file-saver": "^1.3.8",
    "material-design-icons": "^3.0.1",
    "ng4-loading-spinner": "^1.1.3",
    "ngx-bootstrap": "^2.0.0-rc.0",
    "ngx-contextmenu": "^2.0.0-beta.7",
    "ngx-easy-table": "^5.1.0",
    "ngx-loading": "^1.0.14",
    "ngx-modal": "0.0.29",
    "ngx-uploader": "^4.2.4",
    "rxjs": "^6.5.4",
    "tslib": "^1.9.0",
    "vscode-uri": "^1.0.5",
    "zone.js": "^0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "^7.3.9",
    "@angular/compiler-cli": "^9.0.1",
    "@angular/language-service": "^9.0.1",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.2.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "reflect-metadata": "^0.1.10",
    "ts-node": "~3.2.0",
    "tslint": "~5.7.0",
    "typescript": "~3.7.5"
  }
}

enter image description here

But when trying to run the app, I'm getting:

> ng serve

The serve command requires to be run in an Angular project, but a project definition could not be found.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! data-fab-resource-manager@0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the data-fab-resource-manager@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I tried all the tips about deleting cache, deleting package-lock.json, running it from external terminal, etc' but it didn't help!

M_Z
  • 191
  • 1
  • 2
  • 12
  • I think u have a wrong angular cli version. If you have a newer you must have an angular.json. And if you have an old angular cli version you must have a .angular-cli.json In any case, try to migrate your angular proyect and your angular cli You can make it with this comand ng update Regards – Augusto Feb 17 '20 at 14:02
  • make sure that you are running the command in the application root folder.. – Leandro Matilla Feb 17 '20 at 14:08
  • I'm running the command in the application root folder for sure. running > ng update is giving: @angular/core 5.2.11 -> 7.2.16 ng update @angular/core, despite in my packag.json @angular/core is pointing to 9.0.0 – M_Z Feb 17 '20 at 14:15

0 Answers0