Skip to content

[V19] Updating a project in pnpm mono-repo, throws cli mismatch version error #58832

Closed

Description

@spock123

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

Previously when updating a project within our mono-repo (using pnpm, consisting of many angular projects, mostly on v18.2), there were no issues upgrading project-by project.

This time when serving after upgrade, we get a cli mismatch error.
This only happens when running in a mono repo with pnpm.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

% npm run start

> start
> ng serve --host=0.0.0.0 --open

Localization (`localize` option) has been disabled. The development server only supports localizing a single locale per build.
This version of CLI is only compatible with Angular versions ^18.0.0,
but Angular version 19.0.0 was found instead.
Please visit the link below to find instructions on how to update Angular.
https://update.angular.dev/

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.0.1
Node: 20.18.0
Package Manager: pnpm 8.10.5
OS: darwin arm64

Angular: 19.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, material, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.1 (cli-only)
@angular-devkit/build-angular   19.0.1
@angular-devkit/core            19.0.1 (cli-only)
@angular-devkit/schematics      19.0.1 (cli-only)
@angular/cli                    19.0.1
@angular/ssr                    19.0.1
@schematics/angular             19.0.1 (cli-only)
rxjs                            7.5.7
typescript                      5.6.3
zone.js                         0.15.0

Anything else?

Tried re-installing deps, pnpm-lock in root folder, etc.

It seems there is something going on with pnpm and version handling of the cli

Activity

  1. spock123 commented on Nov 22, 2024

    @spock123
    Author

    Snippet from the root pnpm-lock.json

      '@angular/cli':
            specifier: ^19.0.1
            version: 19.0.1(@types/[email protected])
    
  2. spock123 commented on Nov 22, 2024

    @spock123
    Author

    Upgrading to newer @types/node did not make a difference

         '@angular/cli':
            specifier: ^19.0.1
            version: 19.0.1(@types/[email protected])
    
  3. JeanMeche commented on Nov 22, 2024

    @JeanMeche
    Member

    Without a repro this isn't actionnable to us.
    But it looks like you have a v18 instance of the CLI somewhere.

  4. added
    needs reproduction
    on Nov 23, 2024
  5. spock123 commented on Nov 23, 2024

    @spock123
    Author

    @JeanMeche I understand - it's just difficult to repro a large mono repo.
    I can close this case but it's just very odd indeed, as we've never had this issue with previous upgrades.

    I will investigate further and re-open if I find something more specific.

    But here is some weird stuff that I just cannot explain:

    
    %npx ng --version
    19.0.1
    
     %npx ng serve --open --configuration=en
    This version of CLI is only compatible with Angular versions ^18.0.0,
    

    I ended up manually removing node_modules/.bin/ng, then it works fine.
    But every time I install dependencies again, it returns to the same error.

    Must be something weird in our setup so I'll close this now.

  6. angular-automatic-lock-bot commented on Dec 24, 2024

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproduction

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions