dependencies vs devDependencies in package.json

January 4, 2025 (1mo ago)

This post is pretty quick but I wanted to write about when you're supposed to use dependencies vs dev dependencies for installing packages.

In Node.js projects, the package.json file typically has two sections for listing packages your project uses: dependencies and devDependencies. Although both sections declare package requirements, they serve different purposes:

  1. dependencies
  1. devDependencies

In summary, anything your app needs to run in production belongs in dependencies, while anything you only need to develop and test your app belongs in devDependencies.