debowerify icon indicating copy to clipboard operation
debowerify copied to clipboard

Debowerify doesn't seems to work

Open kopax opened this issue 11 years ago • 3 comments

I have installed through bower

$ bower install bootstrap-daterangepicker --save-dev

In my app.js, I try to include it with

var rangePicker = require('bootstrap3-daterangepicker');

Please not that the bower_components is into the folder ./client/ but I have a .bowerrc file with

{ "cwd": "client" }

The bower.json of this library as all the required attributes. (see : https://github.com/dangrossman/bootstrap-daterangepicker/blob/master/bower.json )

Gulp is in charge to do the browserify bundle for me, but I can't make it work, I always got this error :

[18:06:53] Browserify Error { [Error: Cannot find module 'bootstrap3-daterangepicker' from ...

Any suggestion on how to debug this ?

kopax avatar Oct 09 '14 16:10 kopax

I'm running into this issue right now with angular. Did you ever find a solution?

goodbomb avatar Apr 21 '15 02:04 goodbomb

Try this:

var rangePicker = require('bootstrap3-daterangepicker/daterangepicker.js');

and see if it works?

bobthecow avatar Apr 21 '15 10:04 bobthecow

I managed to sort out my own issue last. It would seem I was using browserify's "require" method incorrectly. I had upgraded from an earlier version of Browserify and my build broke. I was doing this:

vendorFiles.forEach(function(lib) {
        b.require(lib);
});

But what I actually had to do was this:

var b = browserify({
        require: vendorFiles
});

I was externalizing the vendor files into a separate build and transforming them with debowerify, but I kept getting "Unable to find module 'libs/angular/angular.js' " even though the path resolved correctly. It all works now. Thanks!

goodbomb avatar Apr 21 '15 16:04 goodbomb