What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?

前端 未结 14 2030
灰色年华
灰色年华 2020-11-22 00:43

This documentation answers my question very poorly. I didn\'t understand those explanations. Can someone say in simpler words? Maybe with examples if it\'s hard to choose si

14条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 01:45

    In short

    1. Dependencies - npm install --save-prod installs packages required by your application in production environment.

    2. DevDependencies - npm install --save-dev installs packages required only for local development and testing

    3. Just typing npm install installs all packages mentioned in the package.json

    so if you are working on your local computer just type npm install and continue :)

提交回复
热议问题