Bower update failed with ‘ERR! error rolling back’

2018 update: Bower might not be the right thing to be using nowadays. Here’s a note from the Bower website: “…psst! While Bower is maintained, we recommend using Yarn and Webpack or Parcel for front-end projects read how to migrate!”


Problem: I just tried to update Bower with:

$ npm update -g bower

Which resulted in failure, and Bower wasn’t able to roll back so the install was fudged. Here’s some output of the errors:

$ npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/bower/.editorconfig'
$ npm ERR! error rolling back  bower@1.2.8 { [Error: EACCES, unlink '/usr/local/lib/node_modules/bower/.editorconfig']
$ npm ERR! error rolling back   errno: 3,

Solution: Firstly I stopped being a dork and remembered I’d need to add ‘sudo’ (the ‘Error: EACCES’ gives it away)…

But first to clear up the mess this worked:

$ sudo npm cache clean

Then…

$ sudo npm update -g bower

Woo!

Please let me know if this little tip was useful, just one click!
Nope, not helpful...Yep, more useful than not! - +4 thumb, 8 overall.
Loading...

One thought on “Bower update failed with ‘ERR! error rolling back’”

Leave a Reply

Your e-mail address will not be published. Required fields are marked *