0

I tried to migrate an application to angular 8, but now when I run my application, I have a dependency problem in my package.json.

After updating angular / cli, when launching the application, I have the following message:

An unhandled exception occurred while processing the request. AggregateException: One or more errors occurred. (One or more errors >occurred. (The NPM script 'start' exited without indicating that the Angular >CLI was listening for requests. The error output was: An unhandled exception >occurred: Cannot find module '@angular/compiler-cli/ngcc'

Here is my package.json file

{
  "name": "ProjetPlanning",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --extract-css",
    "build:ssr": "npm run build -- --app=ssr --output-hashing=media",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/platform-server": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@nguniversal/module-map-ngfactory-loader": "^5.0.0-beta.5",
    "aspnet-prerendering": "^3.0.1",
    "bootstrap": "^3.4.1",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.6",
    "tslib": "^1.10.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
"@angular-devkit/build-angular": "~0.803.3",
"@angular/cli": "^8.3.3",
"@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": "^5.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"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.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
  },
  "optionalDependencies": {
"node-sass": "^4.9.0"

} }

I can not solve this problem and I do not know which dependencies are problematic and why

ChillAndCode
  • 188
  • 2
  • 12
  • You haven't updated any of the other packages. Try using the `ng update --all` command to update all the Angular stuff. – Will Alexander Sep 11 '19 at 13:00
  • @WillAlexander I have this message : `Incompatible peer dependencies found. Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together. You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.` – ChillAndCode Sep 11 '19 at 13:02
  • The answer is in the message. – Will Alexander Sep 11 '19 at 13:02
  • Sorry I'm not clear, when I execute this command, I have this message – ChillAndCode Sep 11 '19 at 13:04
  • The message says you can use the `--force` flag and then address the dependencies afterwards. So go ahead and do that ^^ – Will Alexander Sep 11 '19 at 13:05
  • Use https://update.angular.io/ for guidance when updating Angular. It might be better to update from v5 to v6 first instead of jumping straigt so v8. You also have to update rxjs to v6 which could involve some work, depending on your project. – frido Sep 11 '19 at 13:08
  • @WillAlexander Ok I understood thank you, I'm still a little afraid to use the --force – ChillAndCode Sep 11 '19 at 13:09
  • You have a backup, right? – Will Alexander Sep 11 '19 at 13:11

1 Answers1

0

Change

 "start": "ng serve",
 "build": "ng build --extract-css",

to

"scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",

Refer The NPM script 'start' exited without indicating that the Angular CLI was listening for requests

Chanaka Weerasinghe
  • 5,404
  • 2
  • 26
  • 39