bower install behavior when using mirrored registry

9 views
Skip to first unread message

Anil Poriya

unread,
Mar 31, 2020, 4:14:42 AM3/31/20
to bower
Hi,

Could someone help me with a bower query?

I had a question regarding the behavior of *`bower install`*. We are running bower install and grunt build via maven plugin in a project which has a local `.bowerrc` file ["directory": "app/bower_components"]. The project builds fine when using the official registry of the bower which is https://registry.bower.io

However, when using a mirrored registry in nexus [which I provide in a /root/.bowerrc file], the bower install goes through but grunt build fails with front-end errors because bower packages are installed in a different location.


An example run

*/root/.bowerrc*:

{ "allow_root": true, "registry": { "search": ["<mirrored nexus
registry>""]}, "resolvers": ["bower-nexus3-resolver"], "strict-ssl": false,
"https-proxy": "" }


1. running `bower install` in src/main/webapp/ which has the following
.bowerrc
{
    "directory": "app/bower_components"
}

2. bower.json in src/main/webapp folder:
{
  "name": "<>",
  "version": "<>",
  "license": "<>",
  "dependencies": {
    "bootstrap": "3.3.1"
  }
}

3. bower install leads to the following directory structure:

|- src/main/webapp
  |- bootstrap-3.3.1
    - <contents>
    - bower.json

  |- app
    |- bower_components
      |- bootstrap
        - .bower.json

However, the desired state is:

|- src/main/webapp
  |- app
    |- bower_components
      |- bootstrap
        - contents
        - bower.json


 bootstrap folder in app/bower_components but it is empty with following
.bower.json
 {
  "name": "bootstrap",
  "_source": "<mirrored nexus registry>/bootstrap",
  "_target": "3.3.1",
  "_release": "v3.3.1",
  "version": "v3.3.1",
  "_originalSource": "bootstrap"
}

the bootstrap-3.3.1 folder in src/main/webapp has all the contents.

since the bootstrap folder is empty in app/bower_components, the grunt build fails. Can anyone shed some light on what may have caused this? Does this have to do something with bower or with the nexus registry which is mirrored from bower?

We are running the entire maven build inside a docker container. Thank you for your patience. Your feedback is highly appreciated.

*Environment details*:
bower version: 1.8.8
bower-nexus3-resolver: 1.0.4
node: v6.9.5
npm: 5.0.4

Thanks,
Anil.

Reply all
Reply to author
Forward
0 new messages