You can update all your npm packages with a few commands that I gonna show you today. In the NodeJS projects, you’ll have to update your package dependencies frequently.
Step 1. Install the ncu tool globally
$ npm install -g npm-check-updates
Step 2. Checking updates with ncu
Step 3. Upgrade the packages to its latest major versions
$ ncu --upgrade
Step 4. Install the updated package version using npm install
$ npm install
That’s it. Simple and Clean upgrade.