According to the GitLab Documentation for cache vs artifacts the node_modules should be stored as cache instead of an artifact. The issue with this is if there are multiple runners and a different runner from what created the "build" picks up a job then the cache (node_modules) won't exist which will fail the GitLab CI randomly (if the same runner happens to do the rest of the jobs then it will succeed).
I could make it so everything is done in one job but once I have to put in deployment this issue will reoccur. Another option is to tag it so only one specific runner completes the job but I feel like that is slow.
After researching I realized I could just put in node_modules as an artifact instead of the cache and it will be picked up no matter which runner runs the job but I can't find any documentation on if this is bad or not.
So is it okay to put node_modules as an artifact? If so, why wouldn't people put it as an artifact normally (assuming they add an expiration)?