There is an npm command called npm outdated, which will tell us what packages will be updated.
Before running npm update command which will help us to updated packages, it is always better to run npm outdated first. So it will give you you list of packages with current version, wanted version and latest version.
Whenever we run npm update all packages will be updated to wanted versions which are listed when we run npm update command.
For Example, If you want to update a lodash package to its latest version we need use the following command.
npm i lodash@latest
After completion of installation, run the following command to check which version is installed for lodash.
npm show lodash version