Bowerrc post安装挂钩无法正常工作

dop*_*man 5 javascript frontend bower

根据这篇文章, bower应该能够在1.3.1及更高版本中运行postinstall脚本.我正在使用凉亭1.3.12.

这是我的bowerrc文件:

{
    "scripts": {
        "postinstall": "./node_modules/grunt-cli/bin/grunt"
    }
}
Run Code Online (Sandbox Code Playgroud)

但是,当我使用bower安装软件包时,钩子不会被执行.我究竟做错了什么?

小智 3

我有和你一样的问题。我已通过将变量cwd添加到.bowerrc文件来解决:

{
  "cwd": "./",  
   "scripts": {
        "postinstall": "grunt wiredep"
   }
 }
Run Code Online (Sandbox Code Playgroud)