I use TypeScript 2 in my project. I\'d like to use some js library, but also typings for that library. I can install types with simple npm install @types/some-library<
In the particular case of deploying a Node.js application to production, one wants to install only the dependencies needed to run the application.
npm install --production
or
npm ci --production
or
yarn --production
In that case, the types should be in the devDependencies
, to keep them from bloating the installation.
Remark: I'm aware this was mentioned in a comment by Brad Wilson to another answer. This point seems worthy to be an answer, though.