I'm trying to update my Angular with ng update --all
as in this question stated [https://stackoverflow.com/questions/56419456/cant-find-compiler-ngcc-module-after-upgrading-angular-and-project], but it always says Repository is not clean. Please commit or stash any changes before updating.
I have run the following commands today:
npm install
npm install -g @angular/cli
npm install --save font-awesome angular-font-awesome
npm install angular-alert-module --save
At this state the program compiled
ng update @angular/cli
since then it does not compile
I read I need to do ng update --all --force
but it doesn't work because the repository 'is not clean'.
I made a commit pushed it and pulled (where there were no changes) before. But it didn't help
ng update --all --force
The error-message is:
Repository is not clean. Please commit or stash any changes before updating.
You should use --allow-dirty
if you want to bypass that warning.
This works on @angular/cli v8.0.1+.
ng update --all --allow-dirty
The issue was, that I commited all files (including the package-lock.json) it did mark it as modified. (I don't know why). Therefore the tree was not possible.
Because commiting was not possible (even though the error message suggests it), I had to stash it. Then it worked, but I had to stash after every command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With