How to install packages to devDependencies using npm
Jul 20, 2021
typescript or a types package like
@types/node. These packages should be installed to
devDependencies because you don't need them in production.
npm install some_package won't do the job here because it'll only install the package to
dependencies (which are installed in production).
Install a package to
npm install -D some_package
Here's a more verbose flag that achieves the same result:
npm install --save-dev some_package
Installing only your
You can install only the
devDependencies with this command:
npm install --only=dev