angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng update @angular/cli installs angular 8.2.0-next.0

Open viceice opened this issue 7 years ago β€’ 69 comments

🐞 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?

viceice avatar Jul 03 '19 08:07 viceice

For me the error appeared using @angular/cli installed globally. Installing locally solved my problem

carolitascl avatar Jul 20 '19 20:07 carolitascl

npm install @angular/[email protected]
npx ng update @angular/cdk

Workaround is just installing the cli directly through npm

krokofant avatar Jul 25 '19 08:07 krokofant

This combination doesn't make sense. npm install does a local installation of @angular/cli. npx ng creates a temporary, global "installation" of @angular/cli, executes the command and removes the temporary files again.

db6edr avatar Jul 25 '19 10:07 db6edr

@db6edr That's just how I'm using the angular-cli, without a global installation. You might as well use it without npx but the issue was updating the @angular/cli package through the cli itself and that's what the first command is for. I've had no issue installing other @angular packages, thus the follow-up command to install other packages via the cli.

krokofant avatar Jul 25 '19 10:07 krokofant

Running ng update @angular/cli @angular/cdk @angular/core @angular/material worked for us..

mackelito avatar Jul 25 '19 20:07 mackelito

Package "@angular/material" has an incompatible peer dependency to "@angular/common" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "8.2.0-rc.0").
Package "@angular/material" has an incompatible peer dependency to "@angular/animations" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "8.2.0-rc.0").
Package "@angular/material" has an incompatible peer dependency to "@angular/forms" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "8.2.0-rc.0").
Package "@angular/material" has an incompatible peer dependency to "@angular/core" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "8.2.0-rc.0").
Incompatible peer dependencies found. See above.

Facing the above issue when trying to update cli using ng update @angular/cli. All of the other dependencies updated properly using ng update list, except @angular/cli.

thevirajshelke avatar Jul 30 '19 10:07 thevirajshelke

ng update

Found 56 dependencies. We analyzed your package.json, there are some packages to update:

  Name                                      Version                  Command to update
 ---------------------------------------------------------------------------------------
  @angular/cli                              8.1.2 -> 8.1.3           ng update @angular/cli

ng update @angular/cli

              Package "@angular/flex-layout" has an incompatible peer dependency to "@angular/common" (requires ">=8.0.0-rc.5", would install "8.2.0-rc.0").
              Package "@angular/flex-layout" has an incompatible peer dependency to "@angular/core" (requires ">=8.0.0-rc.5", would install "8.2.0-rc.0").
              Package "@angular/material" has an incompatible peer dependency to "@angular/animations" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "8.2.0-rc.0").
              Package "@angular/flex-layout" has an incompatible peer dependency to "@angular/platform-browser" (requires ">=8.0.0-rc.5", would install "8.2.0-rc.0").
              Package "@nguniversal/module-map-ngfactory-loader" has an incompatible peer dependency to "@angular/platform-server" (requires "^8.0.0" (extended), would install "8.2.0-rc.0").
              Package "@angular/material" has an incompatible peer dependency to "@angular/forms" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "8.2.0-rc.0").
              Package "@swimlane/ngx-charts" has an incompatible peer dependency to "@angular/platform-browser-dynamic" (requires "7.x || 8.x" (extended), would install "8.2.0-rc.0").

blogcraft avatar Jul 31 '19 14:07 blogcraft

Using the --force flag worked for me.

Santosh8055 avatar Aug 01 '19 04:08 Santosh8055

Using the --force flag now will install Angular 9.0.0.next 😱

doronsever avatar Aug 01 '19 07:08 doronsever

It seems
ng update @angular/cli - will update package.json to 9.0.0.next ng update @angular/cli @angular/core - will update package.json to 8.2.0

PS: with @angular/[email protected] globally installed

ilianiv avatar Aug 01 '19 07:08 ilianiv

With @angular/[email protected] installed globally A local ng update @angular/cli installs [email protected] but also installs @angular/core, etc. to "9.0.0-next.0" without doing ng update @angular/core

Using package manager: 'npm'
Collecting installed dependencies...
Found 44 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular/cli @ "8.2.0" (was "8.1.1")...
    Updating package.json with dependency @angular/compiler-cli @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/language-service @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/animations @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular-devkit/build-angular @ "0.802.0" (was "0.801.1")...
    Updating package.json with dependency @angular/common @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/core @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/compiler @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/forms @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/platform-browser @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/router @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency typescript @ "3.5.3" (was "3.4.5")...
UPDATE package.json (1795 bytes)

crissxross avatar Aug 01 '19 09:08 crissxross

I have the same issue but with the new 8.2.0 release it now installs 9.0.0-next.0

Updating package.json with dependency @angular/animations @ "9.0.0-next.0" (was "8.1.3")...
Updating package.json with dependency @angular/compiler @ "9.0.0-next.0" (was "8.1.3")...
Updating package.json with dependency @angular/common @ "9.0.0-next.0" (was "8.1.3")...
Updating package.json with dependency @angular/forms @ "9.0.0-next.0" (was "8.1.3")...
Updating package.json with dependency @angular/core @ "9.0.0-next.0" (was "8.1.3")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "9.0.0-next.0" (was "8.1.3")...
Updating package.json with dependency @angular/router @ "9.0.0-next.0" (was "8.1.3")...

Here's the log. (in order)

PS > ng update
Your global Angular CLI version (8.1.3) is greater than your local
version (8.1.2). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Using package manager: 'npm'
Found 63 dependencies.
    We analyzed your package.json, there are some packages to update:

      Name                                Version                  Command to update
     ---------------------------------------------------------------------------------
      @angular/cdk                        8.1.1 -> 8.1.2           ng update @angular/cdk
      @angular/cli                        8.1.2 -> 8.2.0           ng update @angular/cli
      @angular/core                       8.1.3 -> 8.2.0           ng update @angular/core

Updating the global CLI

PS > npm -g install @angular/[email protected]
omitted\AppData\Roaming\npm\ng -> omitted\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng

> @angular/[email protected] postinstall omitted\AppData\Roaming\npm\node_modules\@angular\cli
> node ./bin/postinstall/script.js

+ @angular/[email protected]
added 1 package from 1 contributor and updated 16 packages in 15.545s

Updating angular

PS > ng update @angular/cli --force
Your global Angular CLI version (8.2.0) is greater than your local
version (8.1.2). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Using package manager: 'npm'
Collecting installed dependencies...
Found 63 dependencies.
Fetching dependency metadata from registry...
                  Package "@angular/flex-layout" has an incompatible peer dependency to "@angular/platform-browser" (requires ">=8.0.0-rc.5", would install "9.0.0-next.0").
                  Package "@angular/flex-layout" has an incompatible peer dependency to "@angular/common" (requires ">=8.0.0-rc.5", would install "9.0.0-next.0").
                  Package "jest-preset-angular" has an incompatible peer dependency to "@angular/core" (requires ">=2.0.0", would install "9.0.0-next.0").
                  Package "jest-preset-angular" has an incompatible peer dependency to "@angular/platform-browser-dynamic" (requires ">=2.0.0", would install "9.0.0-next.0").
    Updating package.json with dependency @angular/cli @ "8.2.0" (was "8.1.2")...
    Updating package.json with dependency @angular/compiler-cli @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/language-service @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/platform-browser @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular-devkit/build-angular @ "0.802.0" (was "0.801.2")...
    Updating package.json with dependency @angular/animations @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/compiler @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/common @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/forms @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/core @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency @angular/router @ "9.0.0-next.0" (was "8.1.3")...
    Updating package.json with dependency typescript @ "3.5.3" (was "3.4.5")...
UPDATE package.json (2989 bytes)

npm WARN @angular/[email protected] requires a peer of @angular/core@>=8.0.0-rc.5 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@>=8.0.0-rc.5 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/platform-browser@>=8.0.0-rc.5 but none is installed. You must install peer dependencies yourself.
npm WARN @azure/[email protected] requires a peer of @angular/common@^4.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @azure/[email protected] requires a peer of @angular/core@^4.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @azure/[email protected] requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/compiler@>=2.3.1 <9.0.0 || >8.0.0-beta <9.0.0 || >8.1.0-beta <9.0.0 || >8.2.0-beta <9.0.0 but none is installed. You must install peer dependencies yourself.        
npm WARN [email protected] requires a peer of @angular/core@>=2.3.1 <9.0.0 || >8.0.0-beta <9.0.0 || >8.1.0-beta <9.0.0 || >8.2.0-beta <9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@>=2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser-dynamic@>=2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/compiler@>=5.x <=8.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@>=5.x <=8.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@>=5.x <=8.x but none is installed. You must install peer dependencies yourself.
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 18 packages from 9 contributors, removed 1 package, updated 46 packages and audited 913394 packages in 49.043s
found 0 vulnerabilities

ng update @angular/core works as expected

snebjorn avatar Aug 01 '19 11:08 snebjorn

I have the same issue. I managed to update @angular/cli and @angular/core by updating them together, but I can't update @angular/cdk as I get the "would install "9.0.0-next.0" error.

SimonWilliams-STL avatar Aug 02 '19 10:08 SimonWilliams-STL

Issue had fix when i use the following command with --force flag..

ng update @angular/cli @angular/core --force

ng update with --force option will update angular irrespective of version conflicts dependencies

Jimit09 avatar Aug 02 '19 11:08 Jimit09

ng update @angular/cli @angular/core worked for me.

I was getting the following error before.

ng update @angular/cli @angular/core @angular/material @angular/cdk @angular/pwa @angular-devkit/build-angular
Using package manager: 'npm'
Collecting installed dependencies...
Found 50 dependencies.
Fetching dependency metadata from registry...
                  Package "@angular/common" has an incompatible peer dependency to "@angular/core" (requires "9.0.0-next.0" (extended), would install "8.2.0").
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "@angular/compiler" (requires "9.0.0-next.0", would install "8.2.0")
                  Package "@angular/common" has an incompatible peer dependency to "@angular/core" (requires "9.0.0-next.0", would install "8.2.0")
                  Package "ngx-mask" has an incompatible peer dependency to "@angular/common" (requires ">=6.0.0", would install "9.0.0-next.0").
                  Package "@angular/forms" has an incompatible peer dependency to "@angular/common" (requires "8.2.0", would install "9.0.0-next.0")
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "@angular/compiler" (requires "9.0.0-next.0" (extended), would install "8.2.0").
                  Package "@angular/platform-browser-dynamic" has an incompatible peer dependency to "@angular/common" (requires "8.2.0", would install "9.0.0-next.0")
                  Package "@angular/platform-browser" has an incompatible peer dependency to "@angular/common" (requires "8.2.0", would install "9.0.0-next.0")
                  Package "@angular/service-worker" has an incompatible peer dependency to "@angular/common" (requires "8.2.0", would install "9.0.0-next.0")
                  Package "@angular/router" has an incompatible peer dependency to "@angular/common" (requires "8.2.0", would install "9.0.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.

Edit: it still happens when I update @angular/material though

fabioemoutinho avatar Aug 02 '19 13:08 fabioemoutinho

Cli team blames material, material team blames cli... angular/components/issues/16596

blogcraft avatar Aug 02 '19 23:08 blogcraft

I'm not using material and still seeing this issue.

jakehockey10 avatar Aug 02 '19 23:08 jakehockey10

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

SergeyCherman avatar Aug 03 '19 22:08 SergeyCherman

Similar problem here - updating from 8.1.1 -> 8.2.0.

A combined ng update @angular/cli @angular/core updates both to 8.2.0.

But when running ng update @angular/material afterwards, all angular dependencies (except for material, cdk and cli) are updated to 9.0.0-next.0

heapifyman avatar Aug 05 '19 11:08 heapifyman

Similar problem here - updating from 8.1.1 -> 8.2.0.

A combined ng update @angular/cli @angular/core updates both to 8.2.0.

But when running ng update @angular/material afterwards, all angular dependencies (except for material, cdk and cli) are updated to 9.0.0-next.0

I have the exact same issue!

prmces avatar Aug 05 '19 15:08 prmces