Hi, I've been a professional developer and DevOps consultant for 18 years 🤓. I share original content from diverse real-world production experiences through monthly blog posts.
node_modules can be huge in real world, and then unsuitable for artifacts which are limited in size. Worth knowing, it is also uploaded to central Gitlab, which can be a bottleneck for a large Gitlab instance with lots of runners uploading to it.
Other than that thank you, I learned that npm ci is slow due to node_modules deletion 🙏
Yes, this! My project's node_modules is 2GB and is too big for artifacts. What is the recommended solution to deal with that? I've had to include npm ci on every step to get my pipeline to work at all.
Hi, I've been a professional developer and DevOps consultant for 18 years 🤓. I share original content from diverse real-world production experiences through monthly blog posts.
You should use cache. This is why cache exists, and can be shared even across pipelines.
But cache has to be configured on your runners, or you will experience missing cache each time your jobs switch runners (which should not be a problem, npm will handle it)
If you compare the time on the clean system, I bet npm ci would be faster than npm install. Cause it just downloads full tree of dependencies from package-lock.json. npm install will check which deps can be updated and build new dependency tree.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
node_modules can be huge in real world, and then unsuitable for artifacts which are limited in size. Worth knowing, it is also uploaded to central Gitlab, which can be a bottleneck for a large Gitlab instance with lots of runners uploading to it.
Other than that thank you, I learned that npm ci is slow due to node_modules deletion 🙏
Yes, this! My project's node_modules is 2GB and is too big for artifacts. What is the recommended solution to deal with that? I've had to include
npm ci
on every step to get my pipeline to work at all.You should use cache. This is why cache exists, and can be shared even across pipelines.
But cache has to be configured on your runners, or you will experience missing cache each time your jobs switch runners (which should not be a problem, npm will handle it)
If you compare the time on the clean system, I bet
npm ci
would be faster thannpm install
. Cause it just downloads full tree of dependencies from package-lock.json.npm install
will check which deps can be updated and build new dependency tree.