provide support to restore cache dependency automatically using npm install for node without using custom path
under review
S
Square Reindeer
provide support to restore cache dependency automatically using npm install for node without using custom path
Currently It is supporting for yarn install with default path (.yarn)
So If you can also provide support for npm install with default path(node_modules) then It will be really helpful for us.
Log In
s
shivkumar.loka
under review
s
shivkumar.loka
Hey Vivek
Thanks for raising this. Today, Cache Intelligence auto‑detects Yarn (yarn.lock) and caches .yarn out of the box. For npm, you currently have two supported options:
- Cache Intelligence + custom path: enable Cache Intelligence on the stage and add /harness/node_modules (Windows: C:\harness\node_modules) under Paths, plus a Key.
- Save/Restore Cache steps: set sourcePaths: node_modules and a key based on package-lock.json.
Please refer to the docs here: https://developer.harness.io/docs/continuous-integration/use-ci/caching-ci-data/cache-intelligence/ | https://developer.harness.io/docs/continuous-integration/use-ci/set-up-build-infrastructure/ci-stage-settings/
We agree this should be zero‑config for npm as well. We’ve logged an enhancement to auto‑detect package-lock.json and cache node_modules by default. We’ll update you as soon as it ships.
Regards
Shivkumar Loka
CI Product Team