I'm getting a permissions error -- or so it seems -- when I try to run the grunt-contrib-imagemin script. I installed grunt-contrib-imagemin like so:
npm install --save-dev grunt-contrib-imagemin
My node and npm are installed in my local user root to avoid needing to use sudo. My setup for grunt-contrib-imagemin in my gruntfile is:
grunt.initConfig({
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'content/',
src: ['**/*.{png,jpg,gif}'],
dest: '/dist'
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-imagemin');
But when I run the commaand grunt imagemin
I get the following error:
Running "imagemin:dynamic" (imagemin) task Warning: Error: EACCES, mkdir '/dist' in file content/01-projects/01-corners-are-for-kissing-in/04-dana/lanningsmith_cornersdetail3.jpg Use --force to continue.
I've checked the permissions on these directories, and it all seems to be write: directories are 775 and files 666. The owners are my user and _www (the user for my server). I assume that given that npm is installed locally that grunt should be running as my user and so there should be no problem. So I'm not sure what's going on here. Ideas?
Aborted due to warnings.
Are you still seeing this issue? If so, what version of grunt-contrib-imagemin are you using? I was having this issue as well, but updating to 0.9.1 resolved it. See this post on their github page: https://github.com/gruntjs/grunt-contrib-imagemin/issues/252