Skip to content

Installation without @angular/animations fails #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mathisvester opened this issue May 25, 2025 · 2 comments
Closed

Installation without @angular/animations fails #525

mathisvester opened this issue May 25, 2025 · 2 comments

Comments

@mathisvester
Copy link

While running ng add @testing-library/angular I got following error:

npm error Conflicting peer dependency: @angular/[email protected]
npm error node_modules/@angular/core
npm error   peer @angular/core@"19.2.13" from @angular/[email protected]
npm error   node_modules/@angular/animations
npm error     peer @angular/animations@">= 17.0.0" from @testing-library/[email protected]
npm error     node_modules/@testing-library/angular
npm error       dev @testing-library/angular@"17.3.7" from the root project
npm error     peerOptional @angular/animations@"19.2.13" from @angular/[email protected]
npm error     node_modules/@angular/platform-browser
npm error       @angular/platform-browser@"^19.2.0" from the root project
npm error       2 more (@testing-library/angular, @angular/router)
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.

When installing @angular/animations everything works fine. Shouldn't be @angular/animations an optional dependency?

Also see quote from https://angular.dev/guide/animations:

IMPORTANT: The Angular team recommends using native CSS for animations instead of the Animations package for all new code. Use this guide to understand existing code built with the Animations Package. See Migrating away from Angular's Animations package to learn how you can start using pure CSS animations in your apps.

@timdeschryver
Copy link
Member

Thanks for reporting this @mathisvester .
At this point we require a dependency on the animations module.
This can be revisited in the next version.

@timdeschryver
Copy link
Member

Closed by #531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants