Skip to content

Can we cache the node-modules folder to run dependencies in pipelines? #6374

Answered by zkochan
TechWatching asked this question in Q&A
Discussion options

You must be logged in to vote

By the way is pnpm/action-setup still the recommended way of setting up pnpm in a GitHub runner, or is corepack enable the way to go?

Maybe, I did not think about it. You can for sure use corepack instead.

In the pnpm documentation it's suggested to cache only the pnpm store (that's what the setup-node action does), but nothing is mentioned about the node-modules. Is there any reason why caching the node-modules directory would be a problem?

Caching sometimes breaks the symlinks, so if you use the default "isolated" node_modules layout, then the restored cache might not work, but I am not sure it is the case on every CI. Also, if you cache node_modules and the store separately and the…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by TechWatching
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants