I'm following the grunt getting started guide for my new app, but I'm having some trouble.
This is my Gruntfile.js
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {,
build: {
src: 'js/*.js',
dest: 'build/*.min.js'
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task(s).
grunt.registerTask('default', ['uglify']);
};
This is my package.json
{
"name": "My App",
"version": "0.0.0",
"description": "",
"author": "",
"license": "N/A",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-uglify": "~0.2.7"
}
}
I have the grunt-cli package installed and I've run npm install to get a local version of grunt and the contrib libraries.
But when I run either grunt
or grunt uglify
nothing happens.
$ grunt
$ grunt uglify
$
Any idea what I have missed or what could cause this behaviour?
EDIT: I just installed mocha too and I get the same issue with that: no output. Maybe there is a problem with my node or npm installation
So it looks like this was an environment setup issue. I had an ubuntu package called node installed as well as nodejs which was preventing the packages installed through npm from working. Running the following command fixed the issue.
sudo apt-get --purge remove node
I had the same problem. Grunt was not responding. No output was being displayed. Removing node and installing nodejs-legacy worked for me.
Removing node by:
sudo apt-get --purge remove node
and installing legacy by:
sudo apt-get install nodejs-legacy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With