Published on

Understanding the difference between `dependencies` and `devDependencies` in `package.json`

Authors
  • avatar
    Name
    hwahyeon
    Twitter

In package.json, there are two types of dependencies: dependencies and devDependencies. What's the difference between them?

  • dependencies refer to the modules that are essential for running the project. Just as a car needs gasoline or electricity to run, a project requires these core modules to function properly. These are the libraries that must be included in the production environment.

  • devDependencies refer to the modules that help developers build or manage the project more efficiently. Similar to how music can make driving more enjoyable, these are tools used exclusively in the development environment, such as build tools, testing frameworks, or linters. They are not usually required in the production environment.

Both types of dependencies are installed in the node_modules folder and managed with commands like npm install or yarn install.