npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

cache configuration details hard to find

I saw someone using npm ci --cache ~/some-dir in a build script.
I couldn’t find any explanation of this --cache flag in or in npm help install.
I guess it defines the location of the NPM cache but I’m still not clear on (a) what is the default value (b) what does it do if there’s a cache-miss, etc.
I’m using NPM 5.8.

Thank you!

The cache is documented here:

Which is also accessible through $ npm help cache.

For future reference, the entire list of config flags for npm lives here:

Available through $ npm help 7 config

It -would- be nice if we documented prefer-offline, prefer-online and offline in a more findable way, so I would love a patch for that if you’re interested! Some mention of the cache option in $ npm help install seems like a good idea.

So I’m moving this to #support:docs-needed!