ng update @angular/cli installs angular 8.2.0-next.0
π Bug report
Command (mark with an x)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
Yes, the previous version in which this bug was not present was: ....Updating angular cli from 8.0.6 to 8.1.0 also updates other angular packages to 8.2.0-next.0 (nextnpm tag)
Description
A clear and concise description of the problem...The cli should update to latest instead of next npm tag.
π¬ Minimal Reproduction
create a angular workspace with angular 8.0.6 and upgrade to 8.1.0
npx -p @angular/[email protected] ng new bug
cd bug
npx -p @angular/[email protected] ng update @angular/cli
π₯ Exception or Error
Using package manager: 'yarn'
Collecting installed dependencies...
Found 81 dependencies.
Fetching dependency metadata from registry...
Package "ng-packagr" has an incompatible peer dependency to "@angular/compiler-cli" (requires "^6.0.0 || ^7.0.0 || ^8.0.0-beta.0 || ^8.1.0-beta.0" (extended), would install "8.2.0-next.0").
Package "@angular/cdk" has an incompatible peer dependency to "@angular/common" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "8.2.0-next.0").
Package "jest-preset-angular" has an incompatible peer dependency to "@angular/core" (requires ">=2.0.0", would install "8.2.0-next.0").
Package "ng-packagr" has an incompatible peer dependency to "@angular/compiler" (requires "^6.0.0 || ^7.0.0 || ^8.0.0-beta.0 || ^8.1.0-beta.0" (extended), would install "8.2.0-next.0").
Package "jest-preset-angular" has an incompatible peer dependency to "@angular/platform-browser-dynamic" (requires ">=2.0.0", would install "8.2.0-next.0").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
π Your Environment
Angular CLI: 8.0.6
Node: 10.15.0
OS: win32 x64
Angular: 8.1.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.800.6
@angular-devkit/build-angular 0.800.6
@angular-devkit/build-ng-packagr 0.800.6
@angular-devkit/build-optimizer 0.800.6
@angular-devkit/build-webpack 0.800.6
@angular-devkit/core 8.0.6
@angular-devkit/schematics 8.0.1
@angular/cdk 8.0.2
@angular/cli 8.0.6
@ngtools/json-schema 1.2.0
@ngtools/webpack 8.0.6
@schematics/angular 8.0.1
@schematics/update 0.800.6
ng-packagr 5.3.0
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0
Anything else relevant?
Bottom line, ng update doesn't work. It get the following errors when attempting to upgrade from Angular 7.
Package "@angular/compiler-cli" has an incompatible peer dependency to "@angular/compiler" (requires "9.0.0-next.0", would install "8.2.0") Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "8.2.0"). Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "8.2.0").
ng update definitely has some problems... material as well. On my end, that's when I try to upgrade @angular/material, it tries to install 9.0.0-next.0 for several packages.
I'm upgrading from 7.1.2. Everything went perfectly until I tried to upgrade @angular/material and @angular/cdk. This is a real PITA...
Similar problem here - updating from 8.1.1 -> 8.2.0. A combined
ng update @angular/cli @angular/coreupdates both to8.2.0. But when runningng update @angular/materialafterwards, all angular dependencies (except for material, cdk and cli) are updated to9.0.0-next.0I have the exact same issue!
These steps helped me resolved the problem:
- Manually edit the version numbers of the depencies which changed to
~9.0.0-next.0"in package.json. Example:"@angular/common": "~9.0.0-next.0"to"@angular/common": "^8.1.2", - Remove node_modules folder
- Run
npm install
Similar problem here - updating from 8.1.1 -> 8.2.0. A combined
ng update @angular/cli @angular/coreupdates both to8.2.0. But when runningng update @angular/materialafterwards, all angular dependencies (except for material, cdk and cli) are updated to9.0.0-next.0I have the exact same issue!
These steps helped me resolved the problem:
- Manually edit the version numbers of the depencies which changed to
~9.0.0-next.0"in package.json. Example:"@angular/common": "~9.0.0-next.0"to"@angular/common": "^8.1.2",- Remove node_modules folder
- Run
npm install
I've gone kinda the same way to resolve the issue. I manually upgrade material and cdk manually with npm and then ran the migration command manually from the schematics of angular CLI. Works perfectly the first time.
I don't even have Angular Material in my project. Just Angular and Bootstrap, that's all and it doesn't work.
In a project with "@angular/core": "~8.1.2", I ran ng update @angular/cli and I got "@angular/cli": "~8.2.0" along with "@angular/core": "~9.0.0-next.0". This seems unexpected to me if I donβt specify --next.
I was expecting to go to "@angular/core": "~8.2.0".
It seems quite surprising to go from a stable to a preview release.
You can use this repo and commit to reproduce/debug: https://github.com/angular-hispano/angular-hispano/commit/7375b34f6e3f2b1158f7430230d2087e1b18d3a6.
I was able to get around these issues via manually updating my package.json to latest angular/angular material versions. Then running: ng update @angular/cli @angular/core --from 7 --to 8 --migrate-only ng update @angular/material --from 7 --to 8 --migrate-only
Run that without the --migrate-only. Finally installed 8.2.1 and NOT 9.0.0.next... (or whatever) Also uninstall all other packages that throw that incompatible peer-dependency Error and reinstall them afterwards. In my case it was angularx-social-login.
I am having the same issue
running this command
ng update @angular/cdk @angular/material @angular/material-moment-adapter
and getting this error -
Package "ag-grid-angular" has an incompatible peer dependency to "@angular/core" (requires ">=2.1.x" (extended),
would install "9.0.0-next.2").
Package "ag-grid-angular" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.1.x" (extended), would install "9.0.0-next.2").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
Do not want to use force option but why i am getting this error.
@ErVishalM: you are getting this error, because somehow angular cli thinks, that 9.0.0-next.2 is the latest version. You can combine your update command with cli and core (as @heapifyman suggested):
ng update @angular/core @angular/cli @angular/cdk @angular/material @angular/material-moment-adapter.
Than somehow the correct version is used for peer dependency check (8.2.x).
It is now having the same problem with the 9.0.0-next.2!
Running ng update:
Name Version Command to update
--------------------------------------------------------------------------------
@angular/cdk 8.0.2 -> 8.1.2 ng update @angular/cdk
@angular/material 8.0.2 -> 8.1.2 ng update @angular/material
Running ng update @angular/material
Updating package.json with dependency @angular/material @ "8.1.2" (was "8.0.2")...
Updating package.json with dependency @angular/language-service @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/compiler-cli @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/cdk @ "8.1.2" (was "8.0.2")...
Updating package.json with dependency @angular/core @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/animations @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/common @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/forms @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/platform-browser @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/router @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/compiler @ "9.0.0-next.2" (was "8.2.2")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "9.0.0-next.2" (was "8.2.2")...
@hpawe01 well not solved from this command also. see run this command -
ng update @angular/core @angular/cli @angular/cdk @angular/material @angular/material-moment-adapter
Using package manager: 'npm'
Collecting installed dependencies...
Found 43 dependencies.
Fetching dependency metadata from registry...
Package '@angular/core' is already up to date.
Package '@angular/cli' is already up to date.
Package "ag-grid-angular" has an incompatible peer dependency to "@angular/core" (requires ">=2.1.x" (extended),
would install "9.0.0-next.2").
Package "ag-grid-angular" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.1.x" (extended), would install "9.0.0-next.2").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
I had the exact same issue, but resolved now . following command worked.
ng update @angular/[email protected] @angular/[email protected] @angular/[email protected]
I hate ng update...
I have the same issue when update @angular/cli 8.1.3 -> 8.2.2
Finally I update in following way:
- just update core
ng update @angular/core - update cli with npm,
npm i @angular/[email protected], also with cdk & material - the build-angular version is related to angular core
npm i @angular-devkit/[email protected]
@nzbin I'm pretty sure this would skip any automatic code migration that would be done by the ng update command. I highly recommend you not to do this, unless someone who knows more about it than me can clear things up.
I can confirm @nzbin case, same here from @angular/cli 8.1.3 -> 8.2.2
In my case it want to install @angular/common 9.0.0-next.2, also when only updating @angular/core
This worked for me: ng update @angular/[email protected] @angular/[email protected]
@JohnnyDevNull I am getting the same error - ng update @angular/[email protected] @angular/[email protected]
Collecting installed dependencies...
Found 43 dependencies.
Package '@angular/core' is already at '8.2.2'.
Fetching dependency metadata from registry...
Package "ag-grid-angular" has an incompatible peer dependency to "@angular/core" (requires ">=2.1.x" (extended),
would install "9.0.0-next.2").
Package "ag-grid-angular" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.1.x" (extended), would install "9.0.0-next.2").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later
Please help us to resolve this issue on priority as we are unable to update angular cli and material
Same issue from 7.2.14 to 8.2.2
this worked for me -
ng update @angular/[email protected] @angular/[email protected] @angular/[email protected]
Still does not work. How are we supposed to update?
Setting the versions by hand does not work either:
ng update @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected]
Using package manager: 'npm'
Collecting installed dependencies...
Found 51 dependencies.
Fetching dependency metadata from registry...
Package "@angular/common" has an incompatible peer dependency to "@angular/core" (requires "9.0.0-next.2" (extended), would install "8.2.2").
Package "@angular/platform-browser-dynamic" has an incompatible peer dependency to "@angular/common" (requires "8.2.2", would install "9.0.0-next.2")
Package "@angular/platform-browser" has an incompatible peer dependency to "@angular/common" (requires "8.2.2", would install "9.0.0-next.2")
Package "@angular/common" has an incompatible peer dependency to "@angular/core" (requires "9.0.0-next.2", would install "8.2.2")
Package "@angular/flex-layout" has an incompatible peer dependency to "@angular/common" (requires ">=8.0.0-rc.5", would install "9.0.0-next.2").
Package "@angular/router" has an incompatible peer dependency to "@angular/common" (requires "8.2.2", would install "9.0.0-next.2")
Package "@angular/forms" has an incompatible peer dependency to "@angular/common" (requires "8.2.2", would install "9.0.0-next.2")
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
Guys, this is a showstopper. If this was a commercial release it would be withdrawn until this issue was resolved. As things stand, following the update instructions results in unreleased beta software being installed. You have to resolve this or pull the update instructions.