Skip to content

Installation without @angular/animations fails #525

Open
@mathisvester

Description

@mathisvester

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions