4

I installed AngularJS via Yeoman scaffolding. When I run

grunt bower-install

It reflexes in the HTML only the dependencies that are in bower.json under the "dependencies" section. How can I make it include the deps under the "devDependencies" section?

Nico Rodsevich
  • 2,393
  • 2
  • 22
  • 32
  • possible duplicate of [Bower and devDependencies vs dependencies](http://stackoverflow.com/questions/19339227/bower-and-devdependencies-vs-dependencies) – montecruiseto Jul 31 '14 at 06:21
  • You'll find everything you need to know, and more [here][1]. [1]: http://stackoverflow.com/questions/19339227/bower-and-devdependencies-vs-dependencies – montecruiseto Jul 31 '14 at 06:22
  • I've seen that post before asking and it didn't explained how to make Grunt install the deps when developing the app – Nico Rodsevich Jul 31 '14 at 06:38

3 Answers3

3

As stated in Angular changelog, bower-install is deprecated in version 9.0.0 see here, now the bower-install task is deprecated and it should be replaced with wiredep. Edit Gruntfile.js file with this:

wiredep: {
  options: {
    cwd: '<%= yeoman.app %>'
  },
  dev: {
    devDependencies: true,
    src: ['<%= yeoman.app %>/index.html'],
    ignorePath:  /\.\.\//
  },
  app: {
    src: ['<%= yeoman.app %>/index.html'],
    ignorePath:  /\.\.\//
  },
  sass: {
    src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
    ignorePath: /(\.\.\/){1,2}bower_components\//
  }
},

And now install DevDependencies with

grunt wiredep:dev

Nico Rodsevich
  • 2,393
  • 2
  • 22
  • 32
2

Apparently I need 50 reputation to comment on the accepted answer so I will have to add here, for anyone in the future that comes across this thread, the changes in accepted answer worked for me but I had to change one other line further down in gruntfile.js

grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    ...

    grunt.task.run([
      'clean:server',
      'wiredep:dev', <-- Changed this from plain 'wiredep'
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });
skolsuper
  • 629
  • 1
  • 6
  • 21
0

If you scaffolded out the Yeoman generator correctly (check for errors in your log), then the dependencies should all have been installed, including those listed under "devDependencies". Failing that please delete your whole bower_componentsfolder, make sure there are no syntax errors in your bower.json and just run

bower install

in your root directory. This will install everything.

montecruiseto
  • 544
  • 3
  • 11