1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to update/ upgrade angular cdk

Discussão em 'Angular' iniciado por Kris Swat, Junho 7, 2025.

  1. Kris Swat

    Kris Swat Guest

    I am a noob in angular and cant understand why update is erroring ?

    Objective : Update version of cdk and material , and then install file-saver

    Command : npm update @angular/cdk

    How to update my angular cdk?

    My package.json


    "@angular/animations": "~13.3.11", "@angular/cdk": "^10.2.7", "@angular/common": "~13.3.11", "@angular/compiler": "~13.3.11", "@angular/core": "~13.3.11",
    "@angular/material": "^10.2.7", ...
    ​

    Error:

    # npm resolution error report

    2023-03-28T18:16:59.106Z

    While resolving: wiseui@1.0.0
    Found: @angular/common@13.3.12
    node_modules/@angular/common
    @angular/common@"~13.3.11" from the root project

    Could not resolve dependency:
    peer @angular/common@"^10.0.0 || ^11.0.0-0" from @angular/cdk@10.2.7
    node_modules/@angular/cdk
    @angular/cdk@"^10.2.7" from the root project

    Fix the upstream dependency conflict, or retry
    this command with --force, or --legacy-peer-deps
    to accept an incorrect (and potentially broken) dependency resolution.

    Raw JSON explanation object:

    {
    "code": "ERESOLVE",
    "current": {
    "name": "@angular/common",
    "version": "13.3.12",
    "whileInstalling": {
    "name": "wiseui",
    "version": "1.0.0",
    "path": "C:\\gegration\\main\\wiseui"
    },
    "location": "node_modules/@angular/common",
    "isWorkspace": false,
    "dependents": [
    {
    "type": "prod",
    "name": "@angular/common",
    "spec": "~13.3.11",
    "from": {
    "location": "C:\\gion\\main\\wiseui"
    }
    }
    ]
    },
    "currentEdge": {
    "type": "prod",
    "name": "@angular/common",
    "spec": "~13.3.11",
    "from": {
    "location": "C:\\....on\\main\\wiseui"
    }
    },
    "edge": {
    "type": "peer",
    "name": "@angular/common",
    "spec": "^10.0.0 || ^11.0.0-0",
    "error": "INVALID",
    "from": {
    "name": "@angular/cdk",
    "version": "10.2.7",
    "whileInstalling": {
    "name": "wiseui",
    "version": "1.0.0",
    "path": "C:\\gooation\\main\\wiseui"
    },
    "location": "node_modules/@angular/cdk",
    "isWorkspace": false,
    "dependents": [
    {
    "type": "prod",
    "name": "@angular/cdk",
    "spec": "^10.2.7",
    "from": {
    "location": "C:\\goion\\main\\wiseui"
    }
    }
    ]
    }
    },
    "strictPeerDeps": false,
    "force": false
    }


    Error when installing file-saver, because this is what I want mainly

    npm install file-saver --save
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE could not resolve
    npm ERR!
    npm ERR! While resolving: @angular/cdk@10.2.7
    npm ERR! Found: @angular/common@13.3.12
    npm ERR! node_modules/@angular/common
    npm ERR! peer @angular/common@">=12.0.0" from @angular/flex-layout@12.0.0-beta.34
    npm ERR! node_modules/@angular/flex-layout
    npm ERR! @angular/flex-layout@"^12.0.0-beta.34" from the root project
    npm ERR! peer @angular/common@"13.3.12" from @angular/forms@13.3.12
    npm ERR! node_modules/@angular/forms
    npm ERR! @angular/forms@"~13.3.11" from the root project
    npm ERR! 7 more (@angular/platform-browser, ...)
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer @angular/common@"^10.0.0 || ^11.0.0-0" from @angular/cdk@10.2.7
    npm ERR! node_modules/@angular/cdk
    npm ERR! peer @angular/cdk@"10.2.7" from @angular/material@10.2.7
    npm ERR! node_modules/@angular/material
    npm ERR! @angular/material@"^10.2.7" from the root project
    npm ERR! @angular/cdk@"^10.2.7" from the root project
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR!
    npm ERR! See ....-cache\eresolve-report.txt for a full report.


    [​IMG]

    [​IMG]

    Continue reading...

Compartilhe esta Página