Too long without output deleting node_modules folder



We’re using CircleCI 2.0, and lately, we’ve seen some jobs fail because deleting the node_modules/ folder takes too long without output:

I don’t think >10min to delete a folder is reasonable.

Can we do something to help debug?


Interesting problem. What is your workspace strategy here - cache the npm cache and get it to reinstall the dependencies without contacting the internet?

I wonder, if you are caching the whole of app/, could you write a Bash script to do your NPM install only if node_modules/ does not exist or is empty? I assume that once this is populated, you do not need to update it in any way, and the dependencies should not change over the jobs in your workflow?

(I appreciate this does not tackle the question about why deletes take such a long time, but it strikes me that even if you solve that problem, it would also be good to avoid unnecessary work, and so my approach would be a better solution).