Skip to content

[BUG] Cannot install @angular/platform-browser-dynamic@19.2.9 alongside jest-preset-angular@14.4.2 #8834

@maleetz

Description

@maleetz

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Using this package.json npm i fails with below error message.

package.json:

{
  "name": "angular-package-install-test",
  "version": "1.0.0",
  "description": "npm i fails with these dependencies",
  "dependencies": {
    "@angular/platform-browser-dynamic": "19.2.9",
    "jest-preset-angular": "14.4.2"
  }
}

Error Message:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: angular-package-install-test@1.0.0
npm error Found: @angular/compiler@19.2.17
npm error node_modules/@angular/compiler
npm error   peer @angular/compiler@"19.2.17" from @angular/compiler-cli@19.2.17
npm error   node_modules/@angular/compiler-cli
npm error     peer @angular/compiler-cli@">=15.0.0 <20.0.0" from jest-preset-angular@14.4.2
npm error     node_modules/jest-preset-angular
npm error       jest-preset-angular@"14.4.2" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @angular/compiler@"19.2.9" from @angular/platform-browser-dynamic@19.2.9
npm error node_modules/@angular/platform-browser-dynamic
npm error   @angular/platform-browser-dynamic@"19.2.9" from the root project
npm error   peer @angular/platform-browser-dynamic@">=15.0.0 <20.0.0" from jest-preset-angular@14.4.2
npm error   node_modules/jest-preset-angular
npm error     jest-preset-angular@"14.4.2" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Observations

If I install jest-preset-angular@14.4.2 by itself, npm resolves @angular/platform-browser-dynamic@19.2.9 instead of the latest 19.x.x version. The peerDependencies for jest-preset-angular should be pulling the latest 19.x.x version as far as I can tell.

  "peerDependencies": {
    "@angular/compiler-cli": ">=15.0.0 <20.0.0",
    "@angular/core": ">=15.0.0 <20.0.0",
    "@angular/platform-browser-dynamic": ">=15.0.0 <20.0.0",
    "jest": "^29.0.0",
    "typescript": ">=4.8"
  },

npm list @angular/platform-browser-dynamic

└─┬ jest-preset-angular@14.4.2
  └── @angular/platform-browser-dynamic@19.2.9

npm list @angular/compiler

└─┬ jest-preset-angular@14.4.2
  ├─┬ @angular/compiler-cli@19.2.17
  │ └── @angular/compiler@19.2.17 invalid: "19.2.9" from node_modules/@angular/platform-browser-dynamic
  └─┬ @angular/platform-browser-dynamic@19.2.9
    └── @angular/compiler@19.2.17 deduped invalid: "19.2.9" from node_modules/@angular/platform-browser-dynamic

npm error code ELSPROBLEMS

Expected Behavior

I would expect npm i to install the dependencies successfully.

Steps To Reproduce

  1. In this environment (Node v25.2.1, MacOS 15.7.2 (24G325))
  2. With this config:
{
  "name": "angular-package-install-test",
  "version": "1.0.0",
  "description": "npm i fails with these dependencies",
  "dependencies": {
    "@angular/platform-browser-dynamic": "19.2.9",
    "jest-preset-angular": "14.4.2"
  }
}
  1. Run npm i
  2. See error (shown above)

Environment

  • npm: 11.6.2
  • Node.js: v25.2.1
  • OS Name: MacOS 15.7.2 (24G325)
  • System Model Name: MacBook Pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions