npm-install
npm-install copied to clipboard
Q: `useRollingCache: true` still results in `npm ci`, but `npm ci` removes `node_modules`?
I’m trying to make a build (mdx-js/mdx) much faster, and am testing useRollingCache: true. It doesn’t seem to do much. Could that be because it still uses npm ci (proof from workflow), but npm ci is faster if:
- The node_modules folder is missing or empty.
due to:
- If a node_modules is already present, it will be automatically removed before npm ci begins its install.
(citations from npm ci docs)
(see also this post by De Voorhoede)
Came here to say the same thing. What is the point of the caching feature, if npm ci nukes the entire node_modules every time?
As documented, folder ~/.npm or ~/.cache/yarn will be cached. So, npm will first check its local cache before querying the npm registry when you execute npm ci.