DEV Community

Discussion on: Multiple projects with same dependencies. How to reduce size?

Collapse
 
joshualjohnson profile image
Joshua Johnson

The short answer is that there is no way to handle similar dependencies over multiple projects. Nor should there be. NPM is designed to be a project package manager. Not a system package manager.

Out of curiosity, what is the drive to combine similar project dependencies?

Collapse
 
goldingdamien profile image
Damien Golding

Thank you for your answer. I fully understand that a project is designed to contain all its dependencies in npm and should do so in production state. However, I would like to be able to do this in a local environment.

The drive is simply for disk space and install speed.
I have a small SSD that I use for development mainly because I am on a budget but want speed. Logically it seems unnecessary to have multiple copies of dependencies on the same machine to run a npm package, and I was thinking maybe there is a solution to easily cache common dependencies in a system wide cache folder.