Managing dependencies versions
If we want to install a specific version of a package, we can use the @ symbol. You can be as specific as you want:
# npm install <package-name>@<version> npm install express@4 npm install express@4.17 npm install express@4.17.1
Outdated dependencies
Eventually, the dependencies that we have installed in our project will be outdated, and we will need to update them. To check if we have any outdated dependencies, we can use the outdated
command:
npm outdated
This command will list all the outdated dependencies, as well as the current version, the wanted version, and the latest version:
Package Current Wanted Latest Location Depended by express 3.21.2 3.21.2 4.18.3 node_modules/express my-project
Now that we are clear on how to handle outdated...