Everything had been working well up until now. I tried rebuilding without cache with no success. I also tried SSH’ing into the boxes and installing bower using the command above and it worked fine. I also cannot reproduce the error locally.
You say you can install everything as expected if you SSH into the machine and run the command manually. Is that right? If so, at which point are you SSHing into the machine? Is that after all the dependencies steps have finished?
I wonder if running all other commands, like npm install, before running npm install -g might actually help.
The bower install happens before npm install. But the builds looks fine now, strangely.
I tried installing bower locally (npm install bower) instead of globally and weirdly that seemed to fix the issue. No idea why. That revealed a legitimate issue with our go build step though, which when fixed, actually didn’t require any changed to our frontend build steps.
So I have no idea why things started acting up. We’re good now though.