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

Same error.

CRACKISH avatar Jul 03 '19 10:07 CRACKISH

I had the exact same issue, but resolved now .

My environment was:

Angular CLI: 7.3.9
Node: 9.11.1
OS: linux 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.13.9
@angular-devkit/build-angular     0.801.0
@angular-devkit/build-optimizer   0.801.0
@angular-devkit/build-webpack     0.801.0
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cli                      7.3.9
@ngtools/webpack                  8.1.0
@schematics/angular               7.3.9
@schematics/update                0.13.9
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.2

ng update showed me 1 package to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       7.3.9 -> 8.1.0           ng update @angular/cli

Running ng update @angular/cli I would get this every time:

Package "ag-grid-angular" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.1.x" (extended), would install "8.2.0-next.0").
Package "ag-grid-angular" has an incompatible peer dependency to "@angular/core" (requires ">=2.1.x" (extended), would install "8.2.0-next.0").

However when I ran ng update @angular/cli @angular/core, it did the trick, and updated the package.

My environment now is:

Angular CLI: 8.1.0
Node: 9.11.1
OS: linux x64
Angular: 8.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.0
@angular-devkit/build-angular     0.801.0
@angular-devkit/build-optimizer   0.801.0
@angular-devkit/build-webpack     0.801.0
@angular-devkit/core              8.1.0
@angular-devkit/schematics        8.1.0
@ngtools/webpack                  8.1.0
@schematics/angular               8.1.0
@schematics/update                0.801.0
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.2

rubyfin avatar Jul 03 '19 16:07 rubyfin

Could you provide the dependency sections of the project's package.json?

clydin avatar Jul 03 '19 16:07 clydin

@clydin - sure, here they are:

"dependencies": {
   "@angular/animations": "~8.1.0",
   "@angular/common": "~8.1.0",
   "@angular/compiler": "~8.1.0",
   "@angular/core": "~8.1.0",
   "@angular/forms": "~8.1.0",
   "@angular/platform-browser": "~8.1.0",
   "@angular/platform-browser-dynamic": "~8.1.0",
   "@angular/router": "~8.1.0",
   "ag-grid-angular": "^21.0.1",
   "ag-grid-community": "^21.0.1",
   "ag-grid-enterprise": "^21.0.1",
   "core-js": "^2.6.9",
   "rxjs": "~6.5.2",
   "tslib": "^1.10.0",
   "zone.js": "~0.9.1"
 },
 "devDependencies": {
   "@angular-devkit/build-angular": "~0.801.0",
   "@angular/cli": "^8.1.0",
   "@angular/compiler-cli": "~8.1.0",
   "@angular/language-service": "~8.1.0",
   "@types/jasmine": "^3.3.13",
   "@types/jasminewd2": "~2.0.6",
   "@types/node": "^11.13.15",
   "codelyzer": "^5.0.1",
   "jasmine-core": "~3.3.0",
   "jasmine-spec-reporter": "~4.2.1",
   "karma": "~4.0.1",
   "karma-chrome-launcher": "~2.2.0",
   "karma-coverage-istanbul-reporter": "~2.0.5",
   "karma-jasmine": "~2.0.1",
   "karma-jasmine-html-reporter": "^1.4.2",
   "protractor": "~5.4.2",
   "ts-node": "~8.0.3",
   "tslint": "~5.14.0",
   "typescript": "~3.4.5"
 }

rubyfin avatar Jul 03 '19 17:07 rubyfin

I have a similar issue. I installed @angular/cli 8.1.0 globally yesterday. Updated a project today using ng update @angular/cli, and it installed Angular 8.2.0-next.0 for all my dependencies.

"dependencies": {
    "@angular/animations": "8.2.0-next.0",
    "@angular/common": "8.2.0-next.0",
    "@angular/compiler": "8.2.0-next.0",
    "@angular/core": "8.2.0-next.0",
    "@angular/forms": "8.2.0-next.0",
    "@angular/platform-browser": "8.2.0-next.0",
    "@angular/platform-browser-dynamic": "8.2.0-next.0",
    "@angular/router": "8.2.0-next.0",
    "core-js": "^2.6.5",
    "rxjs": "^6.5.2",
    "tslib": "^1.9.3",
    "zone.js": "~0.9.1"
},
"devDependencies": {
    "@angular-devkit/build-angular": "~0.801.0",
    "@angular/cli": "8.1.0",
    "@angular/compiler-cli": "8.2.0-next.0",
    "@angular/language-service": "8.2.0-next.0",
    ...

My Angular versions were 8.0.3, the CLI version was 8.0.4.

The application built, and the unit tests passed, so I am not too worried. But, it is odd.

rdrrichards avatar Jul 03 '19 20:07 rdrrichards

I had the same issue when updating from 7.2.14 to 8.1.0 Removing the @angular/http package fixed this for me (allowing me to run the ng update command)

npm un @angular/http

pegan23 avatar Jul 04 '19 00:07 pegan23

Removing @angular/http didn't work for me. Same with ng update @angular/cli @angular/core

mgzurakowski avatar Jul 04 '19 10:07 mgzurakowski

Ive seen the same issue with my projects.

flippingtables avatar Jul 04 '19 17:07 flippingtables

Same issue here...

argygkou avatar Jul 05 '19 08:07 argygkou

Also happening here and I couldn't find a way to make ng update uninstall 8.2.0-next and install 8.1.0 instead. I had to manually change in package.json.

vonBrax avatar Jul 05 '19 09:07 vonBrax

Same issue here, ng update cli and core didn't worked, don't want to remove @angulat/http

krischan1410 avatar Jul 06 '19 18:07 krischan1410

@krischan1410 you may update it to @angular/common/http as the v8 Upgrade Guideline says.

In the other hand, I'm seeing this error for every new minor release since some time ago, the CLI must discard the next releases :-?

matheo avatar Jul 06 '19 19:07 matheo

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

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

andriannus avatar Jul 07 '19 13:07 andriannus

@matheo Thanks for the hint: Now I see that I don't use @angular/http at all. So removing it is not a bug fix for my environment :-)

krischan1410 avatar Jul 07 '19 13:07 krischan1410

Same issue here:

Angular CLI: 8.0.6
Node: 10.16.0
OS: darwin x64
Angular: 8.1.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.6
@angular-devkit/build-angular      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.6
@angular/cdk                       8.0.2
@angular/cli                       8.0.6
@angular/material                  8.0.2
@angular/material-moment-adapter   8.0.2
@ngtools/webpack                   8.0.6
@schematics/angular                8.0.6
@schematics/update                 0.800.6
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.30.0

Error when running ng update @angular/cli :

Using package manager: 'npm'
Collecting installed dependencies...
Found 55 dependencies.
Fetching dependency metadata from registry...
                  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-next.0").
                  Package "@angular/cdk" has an incompatible peer dependency to "@angular/core" (requires "^8.0.0 || ^9.0.0-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 "@angular/material" has an incompatible peer dependency to "@angular/forms" (requires "^8.0.0 || ^9.0.0-0" (extended), 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.

Update 1: solved by deleting node_modules/ and package-lock.json and running a fresh npm install Update 2: Same error on another of our projects, the solution above didn't work for it

hugodes avatar Jul 08 '19 15:07 hugodes

@clydin @alan-agius4 Same issue with cli 8.1.1

OP sent a repro of the issue, were you able to reproduce it on your end ?

Found 43 dependencies.
    We analyzed your package.json, there are some packages to update:
    
      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       8.0.6 -> 8.1.1           ng update @angular/cli
      @angular/core                      8.1.0 -> 8.1.1           ng update @angular/core
      @ngrx/store                        8.0.1 -> 8.1.0           ng update @ngrx/store
🦁 ~/src/squid-web-app (upgrades)
$ ng update @angular/cli
Your global Angular CLI version (8.1.0) is greater than your local
version (8.0.6). 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 43 dependencies.
Fetching dependency metadata from registry...
                  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.1").
                  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-next.1").
                  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-next.1").
                  Package "@angular/cdk" has an incompatible peer dependency to "@angular/core" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "8.2.0-next.1").
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.

hugodes avatar Jul 11 '19 16:07 hugodes

@hugodes just one clarification, on 8.1.1 the message now shows that 8.2.0-next.1 would be installed instead of -next.0

Whatever the issue is, it's being dragged along with new versions.

markgoho avatar Jul 11 '19 16:07 markgoho

Same issue here, please fix

scurk1415 avatar Jul 12 '19 13:07 scurk1415

Using package manager: 'npm'
Collecting installed dependencies...
Found 42 dependencies.
Fetching dependency metadata from registry...
                  Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=2.3.1 <9.0.0 || >8.0.0-beta <9.0.0" (extended), would install "8.2.0-next.1").
                  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-next.1").
                  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-next.1").
                  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-next.1").
                  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.1").
                  Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <9.0.0 || >8.0.0-beta <9.0.0" (extended), would install "8.2.0-next.1").
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.

Same issue

AndreyBespamyatnov avatar Jul 16 '19 09:07 AndreyBespamyatnov

with 8.1.2 version have the same issue.

topikus avatar Jul 18 '19 04:07 topikus