voceconnect / grunt-composer

A grunt wrapper for composer
17 stars 5 forks source link

Warning: Required config property "composer.install" missing #16

Closed cpliakas closed 10 years ago

cpliakas commented 10 years ago

For some reason (probably something I am doing since I am new to Grunt) I cannot run composer commands because Grunt is telling me that the config property is missing. For example, running grunt composer:install produces the following error:

Running "composer:install" (composer) task
Verifying property composer.install exists in config...ERROR
>> Unable to process task.
Warning: Required config property "composer.install" missing. Use --force to continue.

Aborted due to warnings.

My Gruntfile is below:

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        composer : {
            options : {
                usePhp: true,
                composerLocation: '/opt/composer/composer.phar'
            }
        }
    })

    grunt.loadNpmTasks('grunt-composer')
}
cpliakas commented 10 years ago

Error between chair and keyboard. Not only should I read the docs, but I should also follow them in the order the are written.

Putting grunt.loadNpmTasks('grunt-composer') above grunt.initConfig fixed the issue.

Revised Gruntfile is below:

module.exports = function(grunt) {

    grunt.loadNpmTasks('grunt-composer')

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        composer : {
            options : {
                usePhp: true,
                composerLocation: '/opt/composer/composer.phar'
            }
        }
    })
}