Error: [ng:areq] Argument 'module' is not a function, got Object Error: [ng:areq] Argument 'module' is not a function, got Object angularjs angularjs

Error: [ng:areq] Argument 'module' is not a function, got Object


I noticed that you are using require('ng-file-upload') to include the module. Even though the ng-file-upload module is available through npm the downloaded JS files are not in commonJS format.

In order for the require('ng-file-upload') to work in your example the source file would need to export the module like so:

module.exports = angular.module('ng-file-upload').name;

Since this is not the case for the file you are including you need to shim it to work with Browserify. Here is a good article on Properly shim AngularJS applications using Browserify.