Coding⏱️ 2 min read📅 2026-06-03

How to Fix: How do I update devDependencies in NPM?

Update devDependencies in NPM with npm install --save-dev.

Quick Answer: Run "npm install" followed by "npm save" to update devDependencies.

When updating dependencies using npm, it's common to find that devDependencies aren't being updated. This is because npm only updates the packages specified in the dependencies section.

✅ Best Solutions to Fix It

Method 1: Using npm Update with the --save-dev Flag

  1. Step 1: Run npm update --save-dev to update devDependencies.

Method 2: Using npm Link and NPM Publish

  1. Step 1: Create an npm link to your devDependencies by running npm link, then update the dependencies.

🎯 Final Words

To avoid this issue in the future, consider using tools like npm-updater or npm-publish, which can help manage your devDependencies and ensure they're always up-to-date.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions