Error: EPERM: operation not permitted, chmod
See original GitHub issueconst gulp = require('gulp');
const sass = require('gulp-sass');
const csso = require('gulp-csso');
const autoprefixer = require('gulp-autoprefixer');
const uglify = require('gulp-uglify');
const addsrc = require('gulp-add-src');
const concat = require('gulp-concat');
const imageResize = require('gulp-image-resize');
const targetDir = 'dist';
gulp.task('default', ['sass', 'js', 'thumbnails']);
gulp.task('sass', () => {
return gulp.src('src/scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(addsrc('src/css/**/*.css'))
.pipe(autoprefixer())
.pipe(csso())
.pipe(concat('style.css'))
.pipe(gulp.dest(targetDir))
});
// (...)
What’s wrong that gulp sass
doesn’t have permissions to write to dist/style.css
when current user is in group that is owner of this file?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
EPERM: operation not permitted, chmod · Issue #3699 - GitHub
I had an issue where mkdirp@1.0.4/node_modules/mkdirp/bin/cmd.js ended up with root:wheel ownership. That caused me to get ERROR EPERM: ...
Read more >Using gulp with a team on a Local Server. Error: EPERM
I have tried using chmod to change the file permissions but I don't think that is the issue. I use atom as my...
Read more >Gulp returns error: EPERM: operation not permitted, chmod ...
I was working on a script that updated sitemap.xml in the public directory and to do this, it needed permission for writing to...
Read more >Operation not permitted - Justin Webb - Medium
This error tells you that your system could not access and mutate the permission to a file system needed to complete your command....
Read more >Error: EPERM: operation not permit… | Apple Developer Forums
I am installing packages for NODEJS/NPM and am receiving the following error, which, apparently, is not an error with the software, but with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually, it’s a Linux issue not a gulp issue. The problem is that only the owner of a file or root users can change the permissions of of a file, but group users are not allowed to do so. The solution that I did to fix this problem is to change the owner of the file in following way: chown myuser:http . -R Of course with keeping permissions as 775 or 755. This way Apache user (as group user) is still allowed to run/read the files and my user is allowed to run glup command with tasks including chmod.
@jorismak exactly. gulp shouldn’t be attempting to chmod anything, it’s not its purpose. As a very dirty workaround, I’ve been using the code below for the past few years. Just put it somewhere in the gulpfile, and it should bypass the actual chmod call:
const fs = require(‘fs’)
if (1) { fs.chmod = (a, b, cb) => cb(0) }