Closed muuvmuuv closed 2 years ago
FORCE_NG_UPDATE doesn't work in v2 workspaces, because angular CLI can't read them.
People used to use ng update
instead of nx migrate
sometimes because of packageGroup
support, but Nx supports it now. Is there a reason you are still using ng update
that we could resolve?
FORCE_NG_UPDATE doesn't work in v2 workspaces, because angular CLI can't read them.
People used to use
ng update
instead ofnx migrate
sometimes because ofpackageGroup
support, but Nx supports it now. Is there a reason you are still usingng update
that we could resolve?
I'm getting this error in ng update... how to solve this issue?
Workspace config file cannot be loaded: :\\angular.json Invalid format version detected - Expected:[ 1 ] Found: [ 2 ]
FORCE_NG_UPDATE doesn't work in v2 workspaces, because angular CLI can't read them.
For minor updates. We do update cycles every first in the month. I could wait for the nx migrate command to update Angular but for minor updates I dont see any reason when there are no migrations and I just want to benefit from bug fixes and small improvements.
FORCE_NG_UPDATE doesn't work in v2 workspaces, because angular CLI can't read them. People used to use
ng update
instead ofnx migrate
sometimes because ofpackageGroup
support, but Nx supports it now. Is there a reason you are still usingng update
that we could resolve?I'm getting this error in ng update... how to solve this issue?
Workspace config file cannot be loaded: :\angular.json Invalid format version detected - Expected:[ 1 ] Found: [ 2 ]
btw I already resolved this issue by changing "version": 2,
to "version": 1,
in angular.json
just return it to "version": 2,
after successful update,
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏
The issue persists. Does'nt have recent activity, but it isn't solved. There is a workaround, but NX prestige can't be based on such stains.
You do not need to use ng update
. nx migrate
should satisfy any use that you would use ng update
for.
The use case above of wanting to update an angular minor version, you can use nx migrate @angular/core@{v}
. We do not generally recommend this, because nx interfaces with angular's CLI in ways that are not guaranteed to work even if the changes made in @angular-devkit/core are not technically breaking.
Definitely feel free to run the command, do some testing, and see if anything is broken... But there should be no reason to use FORCE_NG_UPDATE...
To be 100% clear, the reason that FORCE_NG_UPDATE
doesn't work in v2 workspaces, is that
angular CLI can't read them
At the implementation level, FORCE_NG_UPDATE
diverts your command away from nx, and goes straight through angular CLI. No patches. If angular CLI doesn't support something, it won't work. They don't support v2 workspaces, but we do and we support running migrations through nx migrate
.
If something is not working with nx migrate
, a new issue should be filed detailing what is currently not working, s.t. it can be properly addressed.
Sorry but:
you can use nx migrate @angular/core@{v}. We do not generally recommend this,
sounds confusing to me. What do you not generally recommend? Updating an especific package to an especific version using nx migrate?
They don't support v2 workspaces, but we do and we support running migrations through nx migrate.
It seems like some kind of a feud; wifh NX and Angular users trying to code in the middle of the battlefield. Anyway, there's no other option than going with those workarounds and I'm happy, less frustrated, to know it.
Even this message can be read in ugly ways, I really apreciate your guidance.
Take it as a fresh view from a new NX user who isn't still used to the details. It can be a fresh view for those who are immersed in NX uses and standards.
Sure, let me clarify:
you can use nx migrate @angular/core@{v}. We do not generally recommend this,
sounds confusing to me. What do you not generally recommend? Updating an especific package to an especific version using nx migrate?
That is the command that we would recommend, but for @angular/core or other angular packages we don't tend to recommend it due to the potential incompatibilities between new versions of @angular-devkit/core and Nx. The reasoning for that is explained a bit in the rest of that paragraph above.
It seems like some kind of a feud
There isn't a feud, we collaborate with the angular team on several things and that's certainly not the takeaway that I am trying to give. The end result is that an Nx workspace is an Nx workspace, not an Angular CLI workspace. An Nx workspace that uses v1 schema for workspace configuration is backwards compatible with Angular CLI, where as an Nx workspace that uses v2 schema or standalone configuration files is no longer backwards compatible with the raw Angular CLI since that is a feature of the Nx CLI tool. When invoking Angular CLI outright, only features that it supports are supported. FORCE_NG_UPDATE disables any compatibility layers that we have in place when using Nx CLI, and thus fails now.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
I cannot force run NG update.
Expected Behavior
Work as described:
Steps to Reproduce
I do not use the decorate js file because it seems odd and I never use ng commands except for this one. Sometimes this works but sometimes I get this error. Have not found out yet in which condition it works.
Failure Logs
Environment