We face a weird issue recently, some pipelines missing node_moudles that had been installed in previous steps.
I’ve tried to add a temp folder for each step but it doesn’t work.
/drone/src is a volume that persists between steps in the same pipeline which means the node_modules folder is available to subsequent steps [1]. I created a simple test and was unable to reproduce the issue you are describing [2][3]. I can confirm there have been no changes or regressions that would prevent this from working as expected.
I have attached a screenshot below that demonstrates my successful test. I have also included links below so that you can see our sample code and configuration, and compare with your own.
The only root cause I am aware of for the issue you described would be yaml misconfiguration. We are happy to help advise, but would kindly request a sample yaml and repository that we can use to reproduce the problem (similar to the sample repository and yaml we provided at the links below).
I am not aware of any instance in which the shared folder would be missing (unless you somehow added a yaml configuration that accidentally conflicted with the shared folder). The shared folder contains the source code cloned from your git repository. If the shared folder was missing, your source code would be missing too.
If the shared folder were missing, and your source code was missing, the npm install would fail due to missing package.json file. This does not seem to be the case based on the error message in your screenshot.
@Amit_Baranes what happens if you change npm ci to npm i?
In my head it is a fresh docker container and install each time the pipeline is run
based on the docs npm-ci | npm Docs - there needs to be a package-lock.json, but I don’t think there would be a package-lock.json because it is a fresh install
apart from that is there any way there could be a jest version mismatch - this feels like more of a node dependency mismatch issue than a drone issue
there is a package-lock.json file since we run npm ci for all our pipelines. the thing is it doesn’t happen all the time. it might happen once \ twice a day or 15 times a day. also, it’s not always jest module but others as well.
as for now, I have 2 guesses -
we do something wrong on the pipeline level.
nodes having issues passing this sharing folder between steps.