-
Notifications
You must be signed in to change notification settings - Fork 161
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
Migrations are failing, when @angular-devkit/core is not on root level in the node_modules #13668
Comments
We will do the following:
|
@Lipata We can't rely on a package we depend on to just be present. We have to make sure we load the package regardless of whether the project already has it or not. |
@kdinev It seems to me like during an However, it is still present in the lock file which causes a peer dependency conflict, so the I managed to reproduce this behavior on a clean Angular project (without using As for |
@jackofdiamond5 Deleting the package-lock worked, I confirm. Should I close the issue, if this is the solution? |
@kdinev This is more of an example of how to get around the problem, we still need to make sure our migrations don't fail in this particular case. After discussing this further with @damyanpetev we agreed to try and dynamically include the core package right before the migrations' execution. This should fix the problem as we will include the package exactly when it is needed which will be right after |
@jackofdiamond5 From what you're describing it seems to me that this is a one-off issue with the migrations and it's caused by the particular Angular update, because they are renaming packages themselves. If that's the case, then it's enough to put guidance in the update guide on how to get the migrations executed correctly. |
Even more details and explanations: Pretty much all installs with recent version of npm (>v7) are performed with As those were suppressed by the linked fix above for the universal package, note how that migration is the last that to update the packages (the bellum-gens> ng update @angular/cli @angular-eslint/schematics
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 17.0.0 to perform the update.
✔ Packages successfully installed.
Using package manager: npm
Collecting installed dependencies...
Found 57 dependencies.
Fetching dependency metadata from registry...
Updating package.json with dependency @angular-devkit/build-angular @ "17.0.0" (was "16.2.2")...
Updating package.json with dependency @angular-eslint/builder @ "17.0.1" (was "16.1.2")...
Updating package.json with dependency @angular-eslint/eslint-plugin @ "17.0.1" (was "16.1.2")...
Updating package.json with dependency @angular-eslint/eslint-plugin-template @ "17.0.1" (was "16.1.2")...
Updating package.json with dependency @angular-eslint/schematics @ "17.0.1" (was "16.1.2")...
Updating package.json with dependency @angular-eslint/template-parser @ "17.0.1" (was "16.1.2")...
Updating package.json with dependency @angular/cli @ "17.0.0" (was "16.2.2")...
Updating package.json with dependency @angular/compiler-cli @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/language-service @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/localize @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency ng-packagr @ "17.0.0" (was "16.2.3")...
Updating package.json with dependency typescript @ "5.2.2" (was "5.1.6")...
Updating package.json with dependency @angular/animations @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/common @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/compiler @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/core @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/forms @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/platform-browser @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/platform-server @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/router @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency @angular/service-worker @ "17.0.2" (was "16.2.5")...
Updating package.json with dependency zone.js @ "0.14.2" (was "0.13.3")...
UPDATE package.json (4324 bytes)
✔ Packages successfully installed.
** Executing migrations of package '@angular-eslint/schematics' **
> Updates @angular-eslint to v17.
UPDATE package.json (4327 bytes)
✔ Packages installed successfully.
Migration completed (1 file modified).
** Executing migrations of package '@angular/cli' **
> Replace usages of '@nguniversal/builders' with '@angular-devkit/build-angular'.
UPDATE angular.json (19219 bytes)
UPDATE package.json (4288 bytes)
Migration completed (2 files modified).
> Replace usages of '@nguniversal/' packages with '@angular/ssr'.
RENAME projects/bellumgens/server-bellumgens.ts => projects/bellumgens/server-bellumgens.ts.bak
RENAME projects/ebleague/server-ebleague.ts => projects/ebleague/server-ebleague.ts.bak
CREATE projects/bellumgens/server-bellumgens.ts (2205 bytes)
CREATE projects/ebleague/server-ebleague.ts (2203 bytes)
UPDATE projects/bellumgens/src/app/app.module.ts (3619 bytes)
UPDATE projects/ebleague/src/app/app.module.ts (3185 bytes)
UPDATE package.json (4273 bytes)
✔ Packages installed successfully.
Migration completed (5 files modified).
> Replace deprecated options in 'angular.json'.
UPDATE angular.json (19203 bytes)
Migration completed (1 file modified).
> Angular v17 introduces a new control flow syntax that uses the @ and } characters.
This migration replaces the existing usages with their corresponding HTML entities.
UPDATE projects/ebleague/src/app/tournament-registration/registration-success/registration-success.component.html (1213 bytes)
Migration completed (1 file modified).
> Updates `TransferState`, `makeStateKey`, `StateKey` imports from `@angular/platform-browser` to `@angular/core`.
Migration completed (No changes made).
> CompilerOption.useJit and CompilerOption.missingTranslation are unused under Ivy.
This migration removes their usage
Migration completed (No changes made). That makes me think while the other packages are installing (core, cli, etc) the universal builder is still present and its dependency to Regardless, for the immediate solution, while nuking npm dedupe --legacy-peer-deps That seems to do the job quite fine damyanpetev/bellum-gens@9287969 - now a single top level After which As for the future direction, yes we're relying on packages we don't explicitly declare as dependencies and we might need some safety measures, yet as mentioned other packages are doing much the same, for example the |
Description
It is possible that the @angular-devkit/core is not at the root level in the node_modules. Migrations are developed so that they require that package on the root level, however, we should revisit that.
Steps to reproduce
or ng update @angular-eslint/schematics @angular/cli @angular/core @infragistics/igniteui-angular @igniteui-cli
Result
Migrations for igniteui-angular or igniteui-cli fails
Expected result
Migrations are executed
The text was updated successfully, but these errors were encountered: