postuninstall hook #1451

me-ascii opened this Issue Aug 6, 2014 · 36 comments


None yet
me-ascii commented Aug 6, 2014


"scripts": {
        "postinstall": "grunt",
        "postuninstall": "grunt"
sheerun commented Aug 6, 2014

It's breaking change + We don't want bower to run this way

@sheerun sheerun closed this Aug 6, 2014
me-ascii commented Aug 6, 2014

Ok, so how to run something after component uninstall?
Can you explain, please, what is breaking?

sheerun commented Aug 6, 2014

Please read the hooks documentation:

me-ascii commented Aug 6, 2014

Just finished re-reading :)
But haven't answer: why you reject postuninstall hook.
So why?
Or which 'best practice' you can advise to make same action?

sheerun commented Aug 6, 2014

The issue description wasn't clear on that, so I assumed you just have problems with hooks in general or want to add "grunt" posthook by default.

@sindresorhus Probably has an answer for your question as he implemented it.

@sheerun sheerun reopened this Aug 6, 2014

No idea. I didn't implement it. Though there probably should be a postuninstall hook.

@sheerun sheerun added this to the 1.4.x milestone Aug 6, 2014
@sheerun sheerun added the enhancement label Aug 6, 2014

Definitely a +1 from me here.

Wiredep suggests adding a postinstall hook to add wiring to HTML files for new packages - it'd be great if there was a corresponding postuninstall to enable the removal operation.

@sheerun sheerun added the help wanted label Jan 5, 2015
whyleee commented Jan 8, 2015


@jvisser jvisser pushed a commit to jvisser/SpringTest that referenced this issue Jan 10, 2015
Jeroen Add postuninstall hook hoping for future support see: bower/bower#1451 b5dbd04

I'm also using the post-installation-hook with bower-requirejs to update the config file. It's not a big issue to have unnecessary dependencies there after an uninstallation, but it's suboptimal...


It would definitely be nice to have this hook. ๐Ÿ‘

atropo commented Feb 2, 2015

+1 for me too, it would be great with wiredep


+1 for me too. Would very nice.

PeterKow commented Feb 3, 2015

+1, simple automatisation and keeps things clean ๐Ÿ‘

mixmode commented Feb 4, 2015


ip2k commented Feb 4, 2015

+1 , esp. for the use-case of wiredep (so it can automatically remove all the script / css tags in your HTML files after Bower uninstalls a thing)


+1, need postuninstall hook for grunt wiredep too.

maccurt commented Mar 10, 2015

Uh duh, yes we need this. If it will inject my css and js when I install something IT SHOULD remove it when I uninstall something. This just seems logical right? Am I missing something? I do appreciate all you do.. Just saying..

sheerun commented Mar 11, 2015

It's not as easy as you think to implement. PR with tests is appreciated :)

maccurt commented Mar 11, 2015

I understand. There is probably something I don't know about. I totally get that. As a developer I am often asked to do something that is estimated to take only 4 hours, a couple weeks later we found out that really was not as easy as the business owner thought it would be

pmentz commented Apr 7, 2015

+1 from me, too
As far as I have seen, there is already a PR #1681 maybe that one would need some support to pass the checks?

sdvim commented Apr 24, 2015

+1, though I found a temporary workaround using grunt-contrib-watch:

    watch: {
      bower: {
        files: ['bower.json', '.bowerrc'],
        tasks: ['wiredep']

And of course you can add templating tasks after wiredep, like jade for example, to generate the updated files.


+1 for wiredep for me too!

mwcz commented May 18, 2015

+1 for me, bower-requirejs user. I have to run bower-requirejs on every grunt build, but I'd much rather run it from a postuninstall hook.


+1. This hook combined with wiredep would be very helpful when completing the workflow for uninstalling packages via bower.


+1 for the postuninstall hook.

kringon commented Aug 17, 2015

I'll +1 this aswell -> don't really see how you implement a postinstall hook without a postuninstall ๐Ÿ’ƒ

Jnull commented Aug 22, 2015

I agree, +1 to postuninstall hook, i endorse this.


+1 for the postuninstall hook.



jimsheen commented Oct 7, 2015




olso commented Oct 22, 2015



+1 :)

sheerun commented Apr 14, 2016

Implemented in #2252 and will be released in bower 1.8

@sheerun sheerun closed this Apr 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment