Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt - Task "assemble" not found

Haven been playing with this for several hours

package.json

{
  "name": "compile-tests",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "grunt": "^0.4.5",
    "assemble": "^0.7.3"
  }
}

Gruntfile.js

module.exports = function(grunt) {
    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        assemble: {
            options: {
                flatten: true,
                layout: "../templates/1.hbs"
            },
            pages: {
                files: {
                    '../dist' : ['../pages/*.hbs']
                }
            }

        }
    });
    grunt.loadNpmTasks('assemble');
    grunt.registerTask('default', ['assemble']);
};

Tried removing and re-installing all the modules a few times. And also tried different versions, interestingly the versions mentioned in this article http://blog.parkji.co.uk/2013/07/06/building-a-static-site-using-grunt-and-assemble.html seem to work but then I get other issues because those versions are out of date.

Error

$ Grunt
>> Local Npm module "assemble" not found. Is it installed?
Warning: Task "assemble" not found. Used --force, continuing.
like image 214
Lindsay Macvean Avatar asked Dec 11 '22 18:12

Lindsay Macvean


1 Answers

I just had to use grunt-assemble

$ npm install grunt-assemble --save-dev

And adjust this line in the Gruntfile.js

grunt.loadNpmTasks('grunt-assemble');
like image 166
Lindsay Macvean Avatar answered Dec 14 '22 14:12

Lindsay Macvean