bower-rails icon indicating copy to clipboard operation
bower-rails copied to clipboard

The json generated file won't be accept by "bower install"

Open phuongnd08 opened this issue 9 years ago • 3 comments

I run bower install with this bower.json (generated by bower-rails):

{
  "lib": {
    "name": "bower-rails generated lib assets",
    "dependencies": {
      "angular-ui-router": "~0.2.15",
      "angular-bootstrap": "~0.14.3"
    }
  },
  "vendor": {
    "name": "bower-rails generated vendor assets",
    "dependencies": {
    }
  }
}

Here what's bower say:

bower                         EINVALID Failed to read /Users/user/app/bower.json

Additional error details:
No name property set

phuongnd08 avatar Nov 14 '15 06:11 phuongnd08

:+1: Me too, running Rails 4.2 on Windows 7

wjdhamilton avatar Dec 14 '15 15:12 wjdhamilton

:+1:

Workaround: In order to install all bower components into only one certain directory strip down the bower.json to:

{
    "name": "bower-rails generated vendor assets",
    "dependencies": {
    }
}

and add a .bowerrc file at project root with e.g. the following content:

{
  "directory" : "vendor/assets/bower_components"
}

jekuno avatar Jan 20 '16 12:01 jekuno

Just ran into this, thanks @jekuno

davidalejandroaguilar avatar Jul 30 '18 17:07 davidalejandroaguilar