While working with NPM and its cache, I noticed that -sometimes- when the newest version of a certain package is not in the cache, npm ci
errors out without bypassing NPM cache.
Is there a way to tell NPM something like "If the package you're looking for is not in the cache, then bypass the cache and try again"?
Thanks in advance.
On a cache miss,
npm
will go to the registry. Cache corruption can cause weirdness, although recent versions ofnpm
handle cache corruption fairly robustly. When in doubt, as you mention in your comment, deleting the cache can fix things, although thenpm
docs suggest avoiding it if at all possible. Usenpm cache clean
(ornpm cache clear
ornpm cache rm
) to clear the cache.