-
Notifications
You must be signed in to change notification settings - Fork 12k
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
'ng update' does not work with yarn workspaces #14841
Comments
Hi, thanks for opening this, however at the moment this is not supported, and hence I am going to mark it as a feature request. |
I'm also struggling with this one while trying to upgrade to Angular 9. Is it possible yet? |
I think there may have been some progress here in recent versions because running
However, the actual update command for a package doesn't work:
Seems like we're almost there. The problem is on this line:
Notice how it says |
Possibly relevant: gatsbyjs/gatsby@3b5e41b Seems like a similar commit in gatsby for resolving issues with yarn workspaces. They replaced read-package-tree with their own implementation. |
Still relevant.
|
I opened a PR at #18610 to implement this. cc @alan-agius4 |
@andreialecu will this work for npm workspaces too? |
@boeckMt I haven't tested it, but the PR I made was package manager agnostic - not yarn specific. It was mainly changing some hard coded path handling to use things like |
I do
and it worked for me. |
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends. Find more details about Angular's feature request process in our documentation. |
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage. We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package. You can find more details about the feature request process in our documentation. |
The issue is happens also in npm workspaces: |
STILL an issue |
For me it works to temporary remove the dependencies that exist locally in the monorepo from the Anyways a direct support from angular would be awesome! |
Still facing issues while migrating from Angular v16 to v17. Is there still no solution for this? |
This issue still exists in Angular v19 this workaround still works though for yarn workspace, update was success. |
Throwing sand in the gears here doesn't make much sense. Angular projects exists in monorepos outside of managed workspaces. That's a fact; it's not going to change. You want this, it means Angular is being used. We're choosing to use Angular but instead of embracing commonly employed and widely accepted practices, Angular is getting in the way. Dictating "the way things should work" rather than accepting reality. Fix this. Making people delete their workspace dependencies before an upgrade is a bizarre requirement. Stop. |
I ended up switching to pnpm for my package manager and using pnpm-workspace.yaml to define my workspace.
|
@michaelurban how did you get the update running I get |
|
🐞 Bug report
Command (mark with an
x
)Is this a regression?
NoDescription
I am utilizing yarn workspaces -feature in my project. Problem is that I have to keep Angular & AngularCLI dependencies on root packages.json, otherwise 'ng update' command can't figure out the version I currently have. I'd rather keep root package.json clean and move Angular & CLI dependencies to project/package.json to keep things isolated.Looking at the code, update command resolves dependencies from root package, even when command is executed on package folder. Would it be possible to change behavior in a way that update would first check package dependencies and the fall back to root if nothing is found?
🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
Root package.json:
'workspace-a/package.json':
Anything else relevant?
The text was updated successfully, but these errors were encountered: