-
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 fails with "Cannot find module '@angular-devkit/schematics'" #16392
Comments
I'm seeing what looks like exactly the same issue. |
Can you provide the output of |
of course before ng update:
after ng update (of course which ends with error):
|
@rokerkony In my case, the update seems to have actually worked, despite the error. I'm not sure if everything has been run through the migration scripts, but after running an npm install (mostly just in case), running ng serve worked perfectly. And it seems to have gotten rid of the Ivy problem I had on angular 8 (changed modules not working with pipes until restarting ng serve). btw, I also used angular material, and updating that ended in the same way, but also seems to have migrated as it should. |
in our case, unfortunately, only the following files have been changed:
and I believe there should be also other files modified in regards to ivy & other changes in v9 |
Hmmmmm, for Ivy itself, the only thing I'd expect it to do was remove Not sure how it will act if you weren't using Ivy already? If it disables Ivy, I'd expect it to only write to tsconfig.app.json to set I don't think there's really any source code changes needed, unless you're using Angular Material and were using top-level imports. Interestingly, my ngsw-config.json wasn't changed for the ng9 upgrade even though I'm using the service worker. |
@rokerkony Prior to updating, can you trying removing both the The underlying cause appears to be that the package in question for some reason was not hoisted by the package manager to a location that the |
@clydin I tried to do "full" reinstall but with the same result but I investigated the app a bit further and I checked it even after an unsuccessful update and it seems to work I just had to manually add to sum up, our app is working but the migration is still not working properly as it didn't finish around 4 steps or so... |
@rokerkony @clydin I'm starting to see some weird stuff that may be related to the botched update. When I try to generate a new component (using
This does not happen in a new 9.0 project. @rokerkony Have you tried to use the CLI to generate components (or, I suspect, any generator) after upgrading? |
@LosD I am experiencing the same behaviour. I encountered the same error during running of the migrations.
and now I receive the same error when trying to generate components etc
Interestingly, I deleted the |
@jadams88 Yep, same for me, nuking An interesting difference from a new project (though this is from memory, as I'm not at the computer now): the root Maybe the Edit: Okay, either I remembered wrong, or it's different at my home office computer, though the effect is the same; on my home machine, it's in But more importantly: Deleting |
The lock file is the controlling element for modern package managers. Only removing the node modules directory and then re-installing will cause the package manager to generate the same node modules directory that was previously present as this is defined within the lock file. |
@clydin Ah, of course. I'm still used to lock files from other languages, where their purpose is only to ensure that all developers and deployments use the same versions, so I never considered that it also affects the tree. |
…unreachable location This is a workaround for the schematics runtime to support the requirement of packages containing migrations (or other schematics) to not have a direct/runtime dependency on the schematics package. Closes: angular#16392
I am trying to update from 8 to v9.0.0-rc.8 and get the same error. I deleted node_modules and lock file. |
@blogcraft Have a look here at the commit to address this Effectively temporarily installing ‘@angular-devkit/schematics‘ yourself prior to the migrations, then uninstall it after should work |
Thanks! Installing I installed it and then it required After that migration worked |
@clydin @alan-agius4 I'm getting this issue updating from Angular 8.2.14 to 9.0 (angular/cli 8.3.25 to 9.0.1) Should this issue be re-opened, or should I file a new issue? $ ng update @angular/cli @angular/core
/tmp/ng-681DTk/angular-errors.log
Reset my project to show state before:
$ npm ls @angular-devkit/schematics
|
@clydin , I tried this advice:
But still get the error. https://stackoverflow.com/a/58111309
Reset again, installed core too: Update succeeds, with commentary on these packages:
|
Same issue with @angular/material
Fixed by |
I ran into same problems when upgrading from 8 to 9 , for all the same reasons. I followed the advise on this thread and was able to correct it by reloading my projects packages and adding the missing packages. If anyone is interested I made a video of what happened here https://youtu.be/ZCMGzo1D2_M skip forward to 5:34 for the steps that worked for me. Cheers |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Description
Hi there, after reading a tweet from Igor to test out the new RC of ng9 I tried it on our application. The update command is not able to be finished even with flag
--force
due to the log below.🔥 Exception or Error
The
angular-errors.log
file content:🌍 Your Environment
I will try to be as helpful as possible, but no clue what more data I could provide atm.
The text was updated successfully, but these errors were encountered: