0

We are migrating couple of years old project to latest one. Package.JSON refers to older version of packages.

"@angular/animations": "^4.4.3",
"@angular/cdk": "^2.0.0-beta.10",
"@angular/common": "^4.0.0"

Is there any mechanism we can put @latest to each version and then execute NPM Update?

"@angular/animations": "@latest",
"@angular/cdk": "@latest",
"@angular/common": "@latest",
Abhijeet
  • 13,562
  • 26
  • 94
  • 175
  • 2
    Possible duplicate of [How do I update each dependency in package.json to the latest version?](https://stackoverflow.com/questions/16073603/how-do-i-update-each-dependency-in-package-json-to-the-latest-version) – alexmac Oct 01 '17 at 10:05

1 Answers1

1

You can change each to "*" and delete the node_modules folder and do npm install.

You should be prepared to fix breaking changes from multiple packages at the same time.

Normally, you should do one at a time, so it is easier to trace breakages and so you know at least what caused it.

If you attempt this, you should make sure you change the versions back to "^X.X.X" in the package.json file. Auto-updating to latest can and will definitely break things over time.

agm1984
  • 15,500
  • 6
  • 89
  • 113