1

I've an angular app. In the package.json I defined for all angular packages the version 12.2.9 like:

"@angular/animations": "^12.2.9",
"@angular/cdk": "^12.2.9",
"@angular/common": "^12.2.9",
"@angular/compiler": "^12.2.9",
"@angular/core": "^12.2.9",
...

I deleted the node_modules folder and the 'package-lock.json`

The I installed all packages with npm install

After that, calling npm outdated, the current version for all my angular packages is 12.2.13 and not 12.2.9

Where is defined, that the 12.2.13 version is installed and not the version from the package.json?

1

1 Answer 1

2

In package-lock.json there is all information about your installed packages in node_modules. if you go there and search the file for @angular/animations for instance you will see your version.

Solution is to delete node_modules and package-lock.json and clear cache by running npm cache clean --force.

UPDATE:


As Harun Yilmaz mentioned in comments:

There are carets (^) in the versions. So, deleting package-lock.json and node_modules and running npm install will still install the latest compatible version.

You can find out what exactly ^ and ~ do in npm package managing in this answer by jgillich.

Sign up to request clarification or add additional context in comments.

3 Comments

Please note that there are carets (^) in the versions. So, deleting package-lock.json and node_modules and running npm install will still install the latest compatible version.
Yeah you're right I forgot to mention that. I will update.
Ah ok - I thought the (^) is only for npm update.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.