Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bowerJson configuration does not give any hints if the path is erronous #197

Closed
kennethlynne opened this issue Jun 26, 2015 · 3 comments
Closed

Comments

@kennethlynne
Copy link

I am trying to configure wiredep to use a bower.json in another directory, and a custom bower_components directory. No success.

var bowerDeps = wiredep({});

Throws ENOENT, no such file or directory '..../bower.json' ✔️

var bowerDeps = wiredep({
    bowerJson: 'does not exist'
});

//bowerDeps is { packages: {} }
// no errors reported?!
@stephenplusplus
Copy link
Member

Yeah, throwing would be a good idea here:

} catch (e) {}
. PR welcome.

@stephenplusplus
Copy link
Member

For some reason I thought you were using the cli. bowerJson is supposed to be an object, the contents of your bower.json file.

@telemakhos
Copy link

@stephenplusplus @kennethlynne I'm having a similar problem with this folder structure:

├── client
│   ├── bower.json
│   ├── bower_components
│   └── src
├── gulpfile.js
├── package.json
└── server

In the gulpfile I was passing the options as paths like this:

var wiredepOptions = {
  exclude: [/bootstrap.js$/, /bootstrap\.css/],
  directory: 'client/bower_components',
  bowerJson: 'client/bower.json'
};

but has been failing silently and nothing is injected in the html. Then after reading this thread I try to pass bower.json as an object with:

var jsonObj = require("./client/bower.json");
var wiredepOptions = {
  exclude: [/bootstrap.js$/, /bootstrap\.css/],
  directory: 'client/bower_components',
  bowerJson: jsonObj
};

but fails warning about packages not installed ..

EDIT: Nevermind, I was writing a path wrongly. It works for me with:

 bowerJson: require("./client/bower.json")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants