Repository navigation
Description
Command
build, test
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
18
Description
Before angular 19 it was possible to have multiple versions of angular each one using it's version of angular-cli in a typical pnpm monorepo.
This was really convenient for migration project-by-project.
It's not working anymore, with a v18 and v19 mix. As any build/test command on angular project will issue the following error.
Minimal Reproduction
I got a minimal reproducible example with a really simple pnpm monorepo initiated from scratch. (https://github.com/DrGrognon/angular-pnpm-monorepo-v18-and-19)
Can be redone easily:
pnpm init
add angular projects with:
pnpx @angular/cli@19 new --package-manager pnpm ng-19 --skip-install
pnpx @angular/cli@18 new --package-manager pnpm ng-18 --skip-install
then create a pnpm-workspace.yaml file with projects:
packages:
- 'ng-18'
- 'ng-19'
Then reproduce with:
pnpm install
cd ng-19
pnpm run buildException or Error
> ng build
This version of CLI is only compatible with Angular versions ^18.0.0,
but Angular version 19.1.3 was found instead.
Please visit the link below to find instructions on how to update Angular.
https://update.angular.dev/
ELIFECYCLE Command failed with exit code 3.
Your Environment
In ng-18 project:
Angular CLI: 18.2.12
Node: 18.20.3
Package Manager: pnpm 9.11.0
OS: linux x64
Angular: 18.2.13
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1802.12
@angular-devkit/build-angular 18.2.12
@angular-devkit/core 18.2.12
@angular-devkit/schematics 18.2.12
@angular/cli 18.2.12
@schematics/angular 18.2.12
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.10
In ng-19 project:
Angular CLI: 19.1.4
Node: 18.20.3
Package Manager: pnpm 9.11.0
OS: linux x64
Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1901.4
@angular-devkit/build-angular 19.1.4
@angular-devkit/core 19.1.4
@angular-devkit/schematics 19.1.4
@angular/cli 19.1.4
@schematics/angular 19.1.4
rxjs 7.8.1
typescript 5.7.3
zone.js 0.15.0
Anything else relevant?
I tested the exact same configuration with 17/18 and 17/19 and everything was working fine.
It look like a strange 18/19 interaction 🤔
This issue is a continuation of angular/angular#58832 (closed for inactivity)
I encounter the exact same problem so i open another issue .
Please let me know if there is another process in this situation.
kudos to angular team, you do awesome work 💓
Activity
fix(@angular/build): utilize bazel stamp instead of resolving peer de…
fix(@angular/build): utilize bazel stamp instead of resolving peer de…
fix(@angular/build): utilize bazel stamp instead of resolving peer de…
DrGrognon commentedon Jan 28, 2025
Whooo that's like the fastest fix ever 😆 !!!
alan-agius4 commentedon Jan 28, 2025
This will be available in 19.2.0-next.1 which should be released tomorrow on NPM.
DrGrognon commentedon Jan 30, 2025
FYI I made a test changing
@angular-devkit/build-angulardependency to the new one :19.2.0-next.1This solved the issue, now serve/build/test work perfectly 👌
Thanks a lot for your quick fix 🙏 (And thanks to all the team for your amazing work on angular !)
Let's go to angular 19 now ! yepeee 🥳
alan-agius4 commentedon Jan 30, 2025
@DrGrognon glad to hear that the change resolved your issue. 😀
angular-automatic-lock-bot commentedon Mar 2, 2025
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.