Reputation: 2708
It seems, I am stuck in an infinite loop of errors in angular. I updated my local angular version from 1.7.0 to angular 8. My global angular version was already 8. Right after updating my angular version to 8, I ran the below command
ng serve
and I got the error saying
"The serve command requires to be run in an Angular project, but a project definition could not be found"
after googling this issue, I ran this command in my terminal window
"ng update @angular/cli --migrate-only --from=1.7.0".
After running this command, I got this error saying
`"Repository is not clean. Please commit or stash any changes before updating.".`
In order to fix the error, I ran this command saying
ng update --all --force.
I again got the error saying
"Repository is not clean. Please commit or stash any changes before updating"
so I ran this command
ng update -all --force --allow-dirty.
when I ran the above command, I got this message:
Repository is not clean. Update changes will be mixed with pre-existing changes.
Using package manager: 'npm'
Collecting installed dependencies...
Found 35 dependencies.
Package '-l' is not a dependency.
after this, I again did
ng serve
and I again got this error saying
"The serve command requires to be run in an Angular project, but a project definition could not be found."
I am willing to go back to angular version 7, but not sure if this will help. below is the image of what I see when I do ng--version
Any help in this regards will be highly appreciated.
Upvotes: 1
Views: 541
Reputation: 1953
There is a command to allow the git status check to be bypassed.
ng update @angular/cli --allow-dirty
The update is checking for uncommitted files and failing as it is possible to get yourself into some trouble if the update goes ahead with out a clean status. A coming up date will only check the Angular files.
Otherwise stash or commit your work and run the update command again.
Upvotes: 2