dopatraman
dopatraman

Reputation: 13908

Bowerrc post install hook not working

According to this post bower should be able to run a postinstall script in versions 1.3.1 and above. I am using bower 1.3.12.

Here's my bowerrc file:

{
    "scripts": {
        "postinstall": "./node_modules/grunt-cli/bin/grunt"
    }
}

However, when I install the package using bower, the hook does not get executed. What am I doing wrong?

Upvotes: 5

Views: 1577

Answers (2)

Bing Wu
Bing Wu

Reputation: 437

The simple reason is because you don't have any packages in your bower.json or all of the packages have been installed.

Please have a look at my issue reported in github: https://github.com/bower/bower/issues/2302

Upvotes: 0

Chung Nguyen
Chung Nguyen

Reputation: 501

I have the same problem as yours. I have been resolved by add an variable cwd to .bowerrc file:

{
  "cwd": "./",  
   "scripts": {
        "postinstall": "grunt wiredep"
   }
 }

Upvotes: 3

Related Questions