Npm caches packages to the directory ( ~/.npm on Linux / OS X and %AppData%/npm-cache on Windows).
This helps when you have multiple installations based on nodejs requiring different packages as dependencies. Npm will not download a package that is already in the cache; instead, it will use the package from the cache if it already exists. Therefore, in this case, he tries to optimize the number of downloads that he should do.
Now that you are using npm cache clean . I used it when, for some reason, my cache is damaged by some conflicting versions of different dependencies, or you just want to clear packages that, as you know, you do not need at all, for example, older versions of certain dependencies.
In principle, after using npm cache clean he likes to have a new nodejs / npm installation, with the exception of the node modules installed all over the world (they will remain with you until you remove them using the npm uninstall ).
Additional information: https://www.npmjs.org/doc/cli/npm-cache.html#CONFIGURATION
ausmarton
source share