generator-angular icon indicating copy to clipboard operation
generator-angular copied to clipboard

Task 'wiredep' is not in your gulpfile

Open mradzinski opened this issue 8 years ago • 7 comments

Generator fails with:

[19:42:09] Using gulpfile ~/Projects/skedul/gulpfile.js
[19:42:09] Task 'wiredep' is not in your gulpfile
[19:42:09] Please check the documentation for proper gulpfile formatting

It seems the generator is trying to run the wiredep task, but in my gulpfile.js wiredep is not a task but a plugin import which gets used by the bower task:

var wiredep = require('wiredep').stream;

// inject bower components
gulp.task('bower', function () {
  return gulp.src(paths.views.main)
    .pipe(wiredep({
      directory: yeoman.app + '/bower_components',
      ignorePath: '..'
    }))
  .pipe(gulp.dest(yeoman.app + '/views'));
});

mradzinski avatar Aug 10 '16 22:08 mradzinski

having the same issue. when running yo angular im getting hung up in the installation at this missing task.

lmkerr avatar Aug 17 '16 05:08 lmkerr

To resolve this I had to make a few changes to the gulpfile.js and where bower_components is installed. These are the changes I had to make to get up and running.

After making these changes I ran bower install again and then gulp serve. The one thing to note is that I moved the bower_components installing into the app folder. The grunt version of this generator uses some middleware to point to bower_components which I assume was done to make the build process smoother or something.

ghost avatar Aug 20 '16 14:08 ghost

Btw, it looks like there already is a pull request (#1247) that will resolve this problem!

ghost avatar Aug 20 '16 14:08 ghost

Why isn't this merged yet?

miparnisari avatar Sep 11 '16 01:09 miparnisari

grunt serve works but I get this error when running grunt build

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: Error: File not found with singular glob: /www/myApp/bower_components/bootstrap/dist/css/bootstrap.css
    at DestroyableTransform.<anonymous> (/www/myApp/node_modules/gulp-useref/index.js:65:28)
    at emitOne (events.js:82:20)
    at DestroyableTransform.emit (events.js:169:7)
    at emitOne (events.js:77:13)
    at DestroyableTransform.emit (events.js:169:7)
    at Glob.<anonymous> (/www/myApp/node_modules/gulp-useref/node_modules/glob-stream/index.js:40:16)
    at Glob.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at Glob.emit (events.js:169:7)
    at Glob._finish (/www/myApp/node_modules/gulp-useref/node_modules/glob-stream/node_modules/glob/glob.js:172:8)
    at done (/www/myApp/node_modules/gulp-useref/node_modules/glob-stream/node_modules/glob/glob.js:159:12)
    at Glob._processSimple2 (/www/myApp/node_modules/gulp-useref/node_modules/glob-stream/node_modules/glob/glob.js:652:12)
    at /www/myApp/node_modules/gulp-useref/node_modules/glob-stream/node_modules/glob/glob.js:640:10
    at Glob._stat2 (/www/myApp/node_modules/gulp-useref/node_modules/glob-stream/node_modules/glob/glob.js:736:12)
    at lstatcb_ (/www/myApp/node_modules/gulp-useref/node_modules/glob-stream/node_modules/glob/glob.js:728:12)
    at RES (/www/myApp/node_modules/inflight/inflight.js:31:16)

Khaleel avatar Dec 02 '16 03:12 Khaleel

This one did the trick for me

rm -rf bower_components node_modules && bower cache clean && npm cache clean && npm install -g gulp wiredep && npm install && bower install

mavieth avatar Dec 13 '16 07:12 mavieth

Everytime I create an angular project using yeoman, I have to install so many dependencies which go unfound when running gulp serve . Any solutions to this?

sudheerkaushik avatar Jan 05 '18 08:01 sudheerkaushik