ck86 / main-bower-files

Getting all main bower files
583 stars 56 forks source link

TypeError: Object * has no method 'on' #129

Closed ghost closed 8 years ago

ghost commented 8 years ago

Getting the following error when i run this code:

Node version: 5.0 Npm version: 3.3.5 Gulp version: 4.9.0

'use strict';

module.exports = function (gulp, config, plugins) {
    return {
        deps: [],
        params: [],
        fn: function () {
            return gulp.src('./bower.json')
                .pipe(plugins.mainBowerFiles())
                .pipe(gulp.dest('Build/libraries'));
        }
    }
};
> cmd.exe /c gulp -b "C:\Dev\Projects\App.se\App.Crm\App.Crm.Build" --color --gulpfile "C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\Gulpfile.js" build:libraries
[16:00:52] Using gulpfile C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\Gulpfile.js
[16:00:52] Starting 'build:libraries'...
[16:00:52] 'build:libraries' errored after 9.86 ms
[16:00:52] TypeError: Object C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\jquery\dist\jquery.js,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\font-awesome\less\font-awesome.less,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\font-awesome\scss\font-awesome.scss,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\angular\angular.js,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\bootstrap\dist\css\bootstrap.css,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\bootstrap\dist\js\bootstrap.js,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\bootstrap\dist\fonts\glyphicons-halflings-regular.eot,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\bootstrap\dist\fonts\glyphicons-halflings-regular.svg,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\bootstrap\dist\fonts\glyphicons-halflings-regular.ttf,C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\bower_components\bootstrap\dist\fonts\glyphicons-halflings-regular.woff has no method 'on'
    at DestroyableTransform.Readable.pipe (C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:516:8)
    at Gulp.fn (C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\Modules\build-libraries.js:9:18)
    at module.exports (C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\node_modules\gulp\node_modules\orchestrator\index.js:134:8)
    at C:\Dev\Projects\App.se\App.Crm\App.Crm.Build\node_modules\gulp\bin\gulp.js:129:20
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
Process terminated with code 1.

And here is my bower.json

{
  "name": "ASP.NET",
  "private": true,
  "directory": "bower_components",
  "dependencies": {
    "bootstrap": "^3.3.6",
    "font-awesome": "^4.5.0",
    "angular": "^1.4.8"
  },
  "overrides": {
    "bootstrap": {
      "main": [
        "dist/css/bootstrap.css",
        "dist/js/bootstrap.js",
        "dist/fonts/glyphicons-halflings-regular.eot",
        "dist/fonts/glyphicons-halflings-regular.svg",
        "dist/fonts/glyphicons-halflings-regular.ttf",
        "dist/fonts/glyphicons-halflings-regular.woff"
      ]
    }
  }
}
ck86 commented 8 years ago

this is not a gulp plugin, you should use it in this way:

return gulp.src(plugins.mainBowerFiles())
  .pipe(gulp.dest('Build/libraries'));
ghost commented 8 years ago

@ck86 Thanks, you saved my day! And thanks for the great plugin!