1

I am getting the following error while trying to do npm install after using the angular's ng update command to update my application from angular 18 to 19.

npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler-cli@"^18.0.0" from @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! peer @angular-devkit/build-angular@">=15.0.0 <19.0.0" from [email protected]
npm ERR! node_modules/jest-preset-angular
npm ERR! dev jest-preset-angular@"^14.3.3" from the root project

My Package JSON:

{
  "name": "my-app",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "jest --detectOpenHandles",
    "test:watch": "jest --watch",
    "test:coverage": "jest --coverage",
    "build:prod": "ng build --configuration production",
    "build:stage": "ng build --configuration stage",
    "build:test": "ng build --configuration test",
    "build:dev": "ng build --configuration development",
    "clean": "rimraf dist && rimraf node_modules",
    "clean:install": "rimraf dist && rimraf node_modules && npm install"
  },
  "jest": {
    "preset": "jest-preset-angular",
    "setupFilesAfterEnv": [
      "<rootDir>/setup.jest.ts"
    ],
    "testPathIgnorePatterns": [
      "<rootDir>/node_modules/",
      "<rootDir>/dist/"
    ],
    "coveragePathIgnorePatterns": [
      "<rootDir>/src/tests/",
      "<rootDir>/src/app/login/",
    
    ],
    "globals": {
      "ts-jest": {
        "tsConfig": "<rootDir>/tsconfig.spec.json",
        "stringifyContentPathRegex": "\\.html$"
      }
    },
    "transformIgnorePatterns": [
      "<rootDir>/node_modules/(?!.*\\.mjs$)"
    ]
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^19.0.0",
    "@angular/common": "^19.0.0",
    "@angular/compiler": "^19.0.0",
    "@angular/core": "^19.0.0",
    "@angular/forms": "^19.0.0",
    "@angular/material": "^19.0.0",
    "@angular/platform-browser": "^19.0.0",
    "@angular/platform-browser-dynamic": "^19.0.0",
    "@angular/router": "^19.0.0",
    "bootstrap": "^5.3.3",
    "moment": "^2.30.1",
    "moment-timezone": "^0.5.46",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.15.0"
  },
  "devDependencies": {
    "@angular/build": "^19.0.2",
    "@angular/cli": "^19.0.2",
    "@angular/compiler-cli": "^19.0.0",
    "@types/jest": "^29.5.13",
    "@types/moment-timezone": "^0.5.13",
    "eslint": "^9.9.0",
    "jest": "^29.7.0",
    "jest-preset-angular": "^14.3.3",
    "rimraf": "^6.0.1",
    "typescript": "~5.5.2"
  }
}


2 Answers 2

1

Support for v19 hasn't landed yet, at least in a stable version.

But you can already test it by installing jest-preset-angular : 14.4.0-rc.0.

Sign up to request clarification or add additional context in comments.

Comments

1

you can now install new version of jest-preset-angular of 14.4.0 and it will work just fine

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.