Updating npm dependencies isn’t a big task, but sometimes it can be more complicated depending on our needs. To understand the package updating mechanism, first, we have to understand the versioning of the packages and the nature of npm.
It will only update to an allowed, close-by version (which is determined by the prefix character: ^, ~): npm update "dependencies": {"sass": "^1.45.2", }
With npm update, we can’t update to a major version (the first number). We should use the npm install command with the latest keyword (using the @ character, we can specify version numbers).