Sono nuovo a NodeJS e Grunt e sto faticando per farlo funzionare. Ecco cosa ottengo:Grunt non si avvia: ">> ReferenceError: grunt is not defined"
$> grunt
Loading "Gruntfile.js" tasks...ERROR
>> ReferenceError: grunt is not defined
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
Ecco la mia Gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
compass: {
dist: {
options: {
config: 'config/config.rb'
}
}
}
});
};
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.registerTask('default', 'compass');
Ed ecco la mia package.json:
{
"name": "tests",
"version": "0.0.0",
"description": "Grunt Tests",
"main": "index.js",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-compass": "~0.6.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-cli": "~0.1.11"
},
"scripts": {
"test": "grunt compass"
},
"repository": {
"type": "git",
"url": "https://github.com/Bertrand31/grunttests.git"
},
"keywords": [
"Grunt",
"NodeJS",
"NPM",
"SASS",
"Compass"
],
"author": "Bertrand Junqua",
"license": "GPL",
"bugs": {
"url": "https://github.com/Bertrand31/grunttests/issues"
},
"homepage": "https://github.com/Bertrand31/grunttests"
}
Oh, e sto facendo funzionare questo su una Debian Wheezy.
Se avete qualche idea, fammelo sapere. Grazie mille ragazzi!
Stai eseguendo il comando dalla stessa directory del tuo Gruntfile? –
Anche io non penso che questo faccia la differenza. Ma penso che le attività del tuo registro dovrebbero essere così: 'grunt.registerTask ('default', ['compass']);'. –