I have a node / angular project that uses npm for backend dependency management and bower for frontend dependency management. I\'d like to use a grunt task to do both install co
You need to tell grunt that you're using an async method (.exec
) by calling the this.async()
method, getting a callback, and calling that when exec is done.
This should work:
module.exports = function(grunt) {
grunt.registerTask('install', 'install the backend and frontend dependencies', function() {
var exec = require('child_process').exec;
var cb = this.async();
exec('bower install', {cwd: './frontend'}, function(err, stdout, stderr) {
console.log(stdout);
cb();
});
});
};
See Why doesn't my asynchronous task complete?