Encountering a permissions issue while attempting to execute the grunt-contrib-imagemin script. The installation of grunt-contrib-imagemin was done as follows:
npm install --save-dev grunt-contrib-imagemin
Node and npm are both installed in my local user root to avoid using sudo. The configuration for grunt-contrib-imagemin in the gruntfile is set up like this:
grunt.initConfig({
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'content/',
src: ['**/*.{png,jpg,gif}'],
dest: '/dist'
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-imagemin');
However, when trying to run the command grunt imagemin
, an error message is displayed:
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.
After verifying the directory permissions, everything appears to be correct: directories have 775 and files have 666 permission settings. The owners are my user and _www (the server user). Since npm is locally installed, it should be running with my user privileges, so the cause of the problem is unclear. Any suggestions?
Aborted due to warnings.