When using the npm cache and why?

When do I need to use npm cache clean ? And why, after using npm cache clean do I get info trying ?

 info trying registry request attempt 1 at 09:54:07 http GET https://registry.npmjs.org/delayed-stream/latest http 304 https://registry.npmjs.org/delayed-stream/latest 
+7
source share
1 answer

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

+5
source share

All Articles