mixu/npm_lazy

'npm install' on existing node_modules bypasses npm_lazy

Closed this issue · 2 comments

I noticed that if I run 'npm install' when previous modules already exist in node_modules, the new modules are installed from the main registry directly (despite registry in npm config being set to npm_lazy).

Not sure if this is even supposed to be supported behavior, just thought I would bring it up.

Thanks

mixu commented

Good point - this is actually a side effect of npm_lazy works: it rewrites the download URLs for package.json results to point to itself, so any previously cached or installed modules will still point to their old urls. There isn't much that npm_lazy can do about previously cached files, but I'll add a documentation notice about this...

After further digging it appears my problem was that I had a prior npm shrinkwrap file that contained hard-coded references to the official registry. Once I updated the shrinkwrap I am now pulling from npm_lazy in every case!

Thanks again.