Examples:
https://integration.wikimedia.org/ci/job/mwext-node20-rundoc/11258/console (MediaWiki-extensions-CodeMirror)
npm error enoent Invalid response body while trying to fetch https://registry.npmjs.org/@mdn%2fbrowser-compat-data: ENOENT: no such file or directory, stat '/cache/_cacache/content-v2/sha512/d0/7f/1fad72fdd3ac07108190d690ec0ea257affe65eabc11586fb47d3409de767efda7c08d815e5b72867496aff14b0fa226c0d0b25d14e1fef6256f4623ba64'
https://integration.wikimedia.org/ci/job/mwext-node20-rundoc/11255/console (Page-Previews)
npm error enoent Invalid response body while trying to fetch https://registry.npmjs.org/eslint-plugin-es-x: ENOENT: no such file or directory, stat '/cache/_cacache/content-v2/sha512/3e/ce/d44958d0453e0a19c29f934eb86e3a80be4922b3ad4ec122d3b21a5678ee5592a7708bb4fe6e3fc77741fa06a958f7e9933d7bded869a6da20aa351f21df'
I think this is the same issue as T373937: mwext-node18-docs-publish failing post-merge for CodeMirror. It's happened a few times since then as well. Each time it seems manually clearing the cache is the fix.
But why does it keep happening? Is there something we can do to guard against this issue?