Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: EPERM #660

Closed
Gazzo100uk opened this issue Sep 3, 2014 · 56 comments
Closed

Error: EPERM #660

Gazzo100uk opened this issue Sep 3, 2014 · 56 comments

Comments

@Gazzo100uk
Copy link

@Gazzo100uk Gazzo100uk commented Sep 3, 2014

I'm getting the following error when running gulp tasks: Error: EPERM, open 'filename....'

Any idea what is causing this or how do I investigate the issue and resolve it?

Regards,
Gary

@contra
Copy link
Member

@contra contra commented Sep 3, 2014

Can you post your gulpfile, OS, version of gulp?

@sindresorhus
Copy link
Contributor

@sindresorhus sindresorhus commented Sep 3, 2014

Also include the full terminal output.

@phated
Copy link
Member

@phated phated commented Sep 4, 2014

Isn't this just a permissions error?

@pkozlowski-opensource
Copy link
Contributor

@pkozlowski-opensource pkozlowski-opensource commented Sep 4, 2014

I saw those errors recently on Windows where a text editor (in this particular case it was Atom) was "locking files" so another node process couldn't delete and even read a given file.

In any case it is hard to help without info that @contra asked for.

@Gazzo100uk
Copy link
Author

@Gazzo100uk Gazzo100uk commented Sep 16, 2014

Yeah it is a permissions issue. I was using visual studio and TFS and I had my workspace configured with the location set to Server. This meant that everything I checked in was given a read only permission on my PC. Changing this workspace location to Local does not give this behaviour and therefore my gulp tasks run okay.

Thanks for the replies folks.

@BrainCrumbz
Copy link

@BrainCrumbz BrainCrumbz commented Oct 13, 2014

Just to mention the we got a similar message when cleaning & compiling again files while Adobe Brackets was open:

Error: EPERM, stat 'some-path-to-a-js-file'

The issue went away when we switched Brackets to open another project directory.

@feiwaltan
Copy link

@feiwaltan feiwaltan commented Nov 4, 2014

I changed the tfs workspace permission on local machine and it still didn't resolve the issue for me. I'm still getting the same error. It seems that every time that we do a gulp build, where the folder is recreated its created as a read only folder.

version of gulp: CLI version 3.8.9, Local version 3.8.10
os: Win 8.1

Error message:

Starting 'images'...
'html' errored after 1.01 s
Error: EPERM, open
'images' errored after 1.01 s
Error: EPERM, open
Finished 'jshint' after 1.29 s
Finished 'bower' after 2.8 s

Edit: Gulp file content:

var requireDir = require('require-dir');
var dir = requireDir('Build/gulpTask');
var gulp = require('gulp');

gulp.task('default', ['bower', 'javascript', 'less', 'html', 'fonts', 'images', 'cssImages', 'jsSourceMap']);

@phated
Copy link
Member

@phated phated commented Nov 19, 2014

No one can help on this because no gulpfile is attached. I have a feeling it is a race condition (maybe due to task dependencies). Please give more information or I will need to close this and direct it towards stack overflow. Thanks

@contra
Copy link
Member

@contra contra commented Nov 28, 2014

@havenchyk del != gulp, if you have errors using del open them on del

@settysreekanth
Copy link

@settysreekanth settysreekanth commented Dec 24, 2014

I had the same issue. It got resolved after I closed Adobe Brackets editor.

@sacredobelisk
Copy link

@sacredobelisk sacredobelisk commented Dec 29, 2014

I am getting the following error when I edit main.js multiple times: Error: EPERM, unlink

In main.js if I have require("jquery") in the file then when I save the file 2 or more times then I get an EPERM error. If I don't have require("jquery") then I do not get the error and I can save the file fine and the generated file generates normally.

output

C:\tools\code\Personal\gulptest>gulp test
info: running tasks as profile -> dev_local
[14:45:05] Using gulpfile C:\tools\code\Personal\gulptest\gulpfile.js
[14:45:05] Starting 'watch'...
[14:45:05] Finished 'watch' after 54 ms
[14:45:05] Starting 'test'...
[14:45:05] Finished 'test' after 14 µs

I edited the JS file at this point.

[14:45:11] Starting 'clean-scripts'...
[14:45:11] Finished 'clean-scripts' after 5.78 ms
[14:45:11] Starting 'process-scripts'...
[14:45:16] Finished 'process-scripts' after 5.63 s
[14:45:16] Starting 'scripts'...
[14:45:16] Finished 'scripts' after 17 µs

And again here.

[14:45:19] Starting 'clean-scripts'...
[14:45:19] 'clean-scripts' errored after 109 ms
[14:45:19] Error: EPERM, unlink 'C:\tools\code\Personal\gulptest\www\js\main.js'

C:\tools\code\Personal\gulptest\package.json

{
    "name": "GulpTest",
    "description": "Gulp Test",
    "version": "0.0.1",
    "private": true,
    "author": "sacredobelisk",
    "dependencies": {
        "jquery": "^2.1.1",
        "lodash": "^2.4.1",
        "q": "^1.1.1"
    },
    "devDependencies": {
        "async": "^0.9.0",
        "browserify": "^6.2.0",
        "del": "^0.1.3",
        "glob": "^4.0.6",
        "gulp": "^3.8.9",
        "gulp-util": "^3.0.1",
        "vinyl-source-stream": "^1.0.0"
    },
    "browser": {
        "other": "/tools/code/Personal/gulptest/libs/other.js",
        "jquery": "/tools/code/Personal/gulptest/libs/jquery.js"
    }
}

C:\tools\code\Personal\gulptest\gulpfile.js

var gulp = require("gulp");

require("./gulp/scripts");
require("./gulp/watch");

gulp.task("test", ["scripts", "watch"]);

C:\tools\code\Personal\gulptest\gulp\watch.js

var gulp = require("gulp");
gulp.task("watch", function() {
    gulp.watch(["./scripts/**/*.js"], ["scripts"]);
});

C:\tools\code\Personal\gulptest\gulp\scripts.js

var gulp = require("gulp");
var browserify = require("browserify");
var del = require("del");
var source = require("vinyl-source-stream");
var glob = require("glob");
var async = require("async");
var path = require("path");
var util = require("gulp-util");
gulp.task("clean-scripts", function(cb) {
    del("./www/js", {
        "force": true
    }, cb);
})
gulp.task("process-scripts", ["clean-scripts"], function(cb) {
    var globString = "./scripts/*.js";
    glob(globString, {}, function(er, files) {
        async.each(files, function(file, nextFile) {
            var name = path.basename(file);
            var b = browserify({
                "debug": true
            });
            b.add(file);
            b.bundle()
                .on("error", function(err) {
                    util.log(util.colors.red("Error"), err.message);
                    this.end();
                })
                .pipe(source(name))
                .pipe(gulp.dest("./www/js"))
                .on("end", nextFile);
        }, cb);
    });
});
gulp.task("scripts", ["process-scripts"])

C:\tools\code\Personal\gulptest\scripts\main.js

// If jquery used then after saving file while running "gulp test" will show EPERM error; using other does not
//var $ = require("jquery");
var $ = require("other");

C:\tools\code\Personal\gulptest\libs\jquery.js - I copied the latest 1.x version from jquery.com
C:\tools\code\Personal\gulptest\libs\other.js - single line: console.log("other");

@contra
Copy link
Member

@contra contra commented Dec 29, 2014

For everyone here: make sure the file permissions are correct on the folder and files you are trying to edit, make sure you do not have a crappy antivirus running that is locking files, make sure you are not using an editor that is locking the file or folders. Kill everything that is running on your computer except gulp to make sure something isn't locking the folders. There is no reason gulp would be putting these errors out, we just use the standard fs.writeFile in node to write stuff. It is something with your environment that is causing this.

@contra contra closed this Dec 29, 2014
@sacredobelisk
Copy link

@sacredobelisk sacredobelisk commented Dec 29, 2014

I've tried all that before posting here. File permissions have been set to "everyone" with full access. I don't have any AVS installed. I used Scite to edit the file. Scite is just a glorified colorized text editor. Nothing else is running except the CMD prompt and Scite when I make the JS changes.

And it's weird cause the first edit of the file works fine. Any subsequent edits fail.

@contra
Copy link
Member

@contra contra commented Dec 29, 2014

@sacredobelisk Close Scite too

@sacredobelisk
Copy link

@sacredobelisk sacredobelisk commented Dec 29, 2014

Alright, edited the file in notepad then. Still same issue. I'm just going to try starting from scratch to see if that helps.

Should note that the file that has the eperm error is the generated file. Not the one that's currently being edited.

@settysreekanth
Copy link

@settysreekanth settysreekanth commented Dec 29, 2014

@sacredobelisk, Delete that generated file and then gulp it again.. This should work.

@sacredobelisk
Copy link

@sacredobelisk sacredobelisk commented Dec 30, 2014

Did a fresh install. Still getting same error.

@settysreekanth Deleted the file. Tried to edit the file again and no luck. Restarting gulp regenerates the file with the changes but I thought the watch task was to avoid running gulp anytime I edit a JS/CSS file.

@contra
Copy link
Member

@contra contra commented Dec 30, 2014

What are the permissions of the input files? gulp will write the output with the same permissions as the input

@sacredobelisk
Copy link

@sacredobelisk sacredobelisk commented Dec 30, 2014

Permissions should be all my user (who is an administrator).

Playing around with making a test project with the configuration above yielded me a working example. I started dropping in code from my work's project into the test project and that's when I saw that the JS file I was editing had this line: var $ = window.$ = window.jQuery = require('jquery');

If I comment out that line I do not get the error. If uncommented, then the error shows up.

That's as far as I got but it's a little late right now and have to be up early so signing off for now.

@contra
Copy link
Member

@contra contra commented Dec 30, 2014

@sacredobelisk So the files for the jquery module are not right? Did you sudo npm install jquery or something?

@sacredobelisk
Copy link

@sacredobelisk sacredobelisk commented Dec 31, 2014

I just created a new file and copied the contents from jquery.com in chrome.

I updated my first comment with the code as it stands now. I tried removing as much as possible to narrow down where my issue is coming from.

I can reproduce this consistently now in my surface pro 3 (Win 8.1) and my desktop (Win 7).

@contra
Copy link
Member

@contra contra commented Dec 31, 2014

@sacredobelisk Can you make a git repo of the barebones needed to reproduce this issue so we can isolate this

@sacredobelisk
Copy link

@sacredobelisk sacredobelisk commented Dec 31, 2014

@sacredobelisk
Copy link

@sacredobelisk sacredobelisk commented Jan 6, 2015

Anyone else have any luck being able to reproduce this? Or found a solution that I haven't had luck finding?

@schleumer
Copy link

@schleumer schleumer commented Jan 8, 2015

I got the same problem and possible sources. When I found the same problem the first first thing I did was check which files gulp was hanging on(lsof) and, bang, there was the file which del couldn't clean.

First possible source: browserify keep files opened so del can't clean the directory;
Second possible source: vinyl-source-stream keep files opened so del can't clean the directory;
Third possible source: gulp.dest keep files opened after write so del can't clean the directory;
Fourth possible source: while gulp-watch watches files it keep somehow the file opened so del can't clean the directory;

But i think it's more Browserify or Vinyl problem than gulp itself.

My OS at moment is Windows 8.1, also tested in OS X Yosemite and ArchLinux. File permissions are ok and triple checked.

It's my gulpfile https://gist.github.com/schleumer/9e07d040d1a773511405 of course it's not complete, i just removed useless tasks which is not related.

@contra
Copy link
Member

@contra contra commented Jan 8, 2015

@schleumer Nothing but browserify, gulp-watch, and gulp.dest actually touch the file system they just deal with the in-memory files. gulp.dest just uses fs.writeFile to write a file so it isn't that keeping it open.

@contra
Copy link
Member

@contra contra commented Jan 8, 2015

@sacredobelisk I downloaded your test repo and I am able to reproduce an ENOENT error which is different from your EPERM issue, but the bug is from browserify not from gulp. You installed the browserify module, created a bundle, and then the bundle throws an error. This has nothing to do with gulp, so the issue should be opened on browserify or you should check if there already is one. You should completely remove gulp from the equation when opening that issue so it is easier for them to reproduce and diagnose it.

@schleumer
Copy link

@schleumer schleumer commented Jan 8, 2015

Thanks, @contra! I'll move my issue to Browserify and gulp-watch, because gulp-watch already have some issues like mine and this don't happen only with Browserify, kinda weird. Thanks again, sorry for the mess.

@feiwaltan
Copy link

@feiwaltan feiwaltan commented Jun 12, 2015

@nover
Currently I am also using TFS 2013 but no longer encounter the issue with gulp EPERM error.

We resolved this by making the tfs workspace local, this also allows us to work offline if tfs goes down and we haven't had any issues with merging changes.

Reference to configure: https://msdn.microsoft.com/en-us/library/gg490753(v=vs.100).aspx

@KE-Cbu
Copy link

@KE-Cbu KE-Cbu commented Jun 19, 2015

I got the same problem.. With TFS 2013. I change my workspace from server to local and it solves this point.

@mvarblow
Copy link

@mvarblow mvarblow commented Sep 3, 2015

I have the same problem with TFS, but don't have the option to use a local workspace due to the size of our solution. Is it possible to get gulp to NOT set the read-only flags on the output files?

@feiwaltan
Copy link

@feiwaltan feiwaltan commented Sep 4, 2015

@mvarblow There's a way to create a gulp task that would allow you to update the file permission from read to write, but that would be problematic when you check stuff back in, might have merge conflicts on each checkin.

Here is a library that will assist with that: https://www.npmjs.com/package/gulp-chmod

@EjaYF
Copy link

@EjaYF EjaYF commented Jan 11, 2016

Thanks @feiwaltan for sharing this. I use gulp in VS2015 for copying from /js to /jsdest which is the folder from where I am referencing the scripts in my browser. I only edit the /js files, so no problems with local workspace or TFS issues for me :)

@8raveStarr
Copy link

@8raveStarr 8raveStarr commented Jan 29, 2016

@EjaYF How did you include your /jsdest folder in the project so it would publish that content, but not include it in source control/TFS? I have tried to select the files and use the Files > Source Control > Advanced > Exclude File from Source Control, but that still sets a read-only property on the file. That then causes issues with Gulp.

@EjaYF
Copy link

@EjaYF EjaYF commented Feb 1, 2016

@8raveStarr I think your solution is fine. Make sure the file is not readonly. And use
.pipe(chmod(755))
I guess from that moment you won't have read-only attributes anymore...

@EjaYF
Copy link

@EjaYF EjaYF commented Feb 8, 2016

@8raveStarr I was facing the exact problem as you did now... This helped me: http://stackoverflow.com/questions/29483772/remove-windows-file-readonly-attribute-in-gulp-file

The solution is to remove the readonly attribute beforehand:

require("child_process").exec("attrib -r <dir-name>\*.* /s");

@yogeshnikam
Copy link

@yogeshnikam yogeshnikam commented Jul 29, 2016

I have one problem related to setting the permission for js file, I am using gulp for combining multiple files into one. For that's what i am doing i am setting permission for the compiled file. Using gulp-chmod package, so that I can set the permission for the files,
Suppose i set write:false and run gulp it will set the file read only, but at the time of again removing the permission I am going to set write:true but that time I am getting the error. EPERM: Operation not permitted, this is because of that read-only property true for the compiled file. If i manually remove the read-only property and run gulp again it will resolve. But I want to remove that property using gulp if i set the option write: true still i am getting error, is there another way to resolve the issue.

@golddragon007
Copy link

@golddragon007 golddragon007 commented Aug 9, 2016

Actually I have simmilar problem... Actually I start the watch task, once it compile from less to css, than when it's start the real watch, it's dies.
Console:
[23:03:47] Using gulpfile /mnt/d/phptest/[...]/gulpfile.js
[23:03:47] Starting 'less'...
[23:03:49] Finished 'less' after 1.83 s
[23:03:49] Starting 'default'...
[23:03:49] 'default' errored after 13 ms
[23:03:49] Error: watch /mnt/d/phptest/[...]/less/ EPERM
at exports._errnoException (util.js:1012:11)
at FSWatcher.start (fs.js:1429:19)
at Object.fs.watch (fs.js:1456:11)
at Gaze._watchDir (/mnt/d/phptest/[...]/node_modules/gaze/lib/gaze.js:289:30)
at /mnt/d/phptest/[...]/node_modules/gaze/lib/gaze.js:358:10
at iterate (/mnt/d/phptest/[...]/node_modules/gaze/lib/helper.js:52:5)
at Object.forEachSeries (/mnt/d/phptest/[...]/node_modules/gaze/lib/helper.js:66:3)
at Gaze._initWatched (/mnt/d/phptest/[...]/node_modules/gaze/lib/gaze.js:354:10)
at Gaze.add (/mnt/d/phptest/[...]/node_modules/gaze/lib/gaze.js:177:8)
at new Gaze (/mnt/d/phptest/[...]/node_modules/gaze/lib/gaze.js:74:10)

gulpfile.js
/*global -$ */
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var less = require('gulp-less');

// Error notifications
var reportError = function(error) {
$.notify({
title: 'Gulp Task Error',
message: 'Check the console.'
}).write(error);
console.log(error.toString());
this.emit('end');
}

// less processing
gulp.task('less', function() {
return gulp.src('less/style.less')
.pipe($.sourcemaps.init())
// Convert less into css
.pipe($.less({
outputStyle: 'nested', // libless doesn't support expanded yet
precision: 10
}))
// Show errors
.on('error', reportError)
// Autoprefix properties
.pipe($.autoprefixer({
browsers: ['last 2 versions']
}))
// Write sourcemaps
.pipe($.sourcemaps.write())
// Save css
.pipe(gulp.dest('css'));
});

// process JS files and return the stream.
gulp.task('js', function () {
return gulp.src('js/*.js')
.pipe(gulp.dest('js'));
});

// Optimize Images
gulp.task('images', function() {
return gulp.src('img/*')
.pipe($.imagemin({
progressive: true,
interlaced: true,
svgoPlugins: [{
cleanupIDs: false
}]
}))
.pipe(gulp.dest('img'));
});

// JS hint
gulp.task('jshint', function() {
return gulp.src('js/*.js')
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.notify({
title: "JS Hint",
message: "JS Hint says all is good.",
onLast: true
}));
});

// Beautify JS
gulp.task('beautify', function() {
gulp.src('js/*.js')
.pipe($.beautify({indentSize: 2}))
.pipe(gulp.dest('js'))
.pipe($.notify({
title: "JS Beautified",
message: "JS files in the theme have been beautified.",
onLast: true
}));
});

// Compress JS
gulp.task('compress', function() {
return gulp.src('js/*.js')
.pipe($.sourcemaps.init())
.pipe($.uglify())
.pipe($.sourcemaps.write())
.pipe(gulp.dest('js'))
.pipe($.notify({
title: "JS Minified",
message: "JS files in the theme have been minified.",
onLast: true
}));
});

// Run drush to clear the theme registry
gulp.task('drush', function() {
return gulp.src('', {
read: false
})
.pipe($.shell([
'drush cc css-js',
]))
.pipe($.notify({
title: "Caches cleared",
message: "Drupal CSS/JS caches cleared.",
onLast: true
}));
});

// Default task to be run with gulp
gulp.task('default', ['less'], function() {
gulp.watch("less/.less", ['less']);
gulp.watch("js/
.js", ['js']);
});

OS: windwos 10, script running from bash on windows console, also, it was installed the linux version of everything. All files are set to anybody can read/write/execute from linux console, and in window permission, the administrator, user, anybody roles has full (complette) permission (read/write/execute/etc).

Anybody?

@andrewfluck
Copy link

@andrewfluck andrewfluck commented Aug 16, 2016

I'm getting the same exact issue

@cocoademon
Copy link

@cocoademon cocoademon commented Aug 18, 2016

Hello all, I had the same issue on Windows with Browserify/Babelify.

I resolved it by adding the buffer stage to the pipeline, ie changing:

return bundler
        .bundle()
        .on('error', gutil.log.bind(gutil, 'Browserify Error'))
        .pipe(source('content/js/main.js'))
        .pipe(gulp.dest('build'));

to:

var buffer = require('vinyl-buffer');

...

return bundler
        .bundle()
        .on('error', gutil.log.bind(gutil, 'Browserify Error'))
        .pipe(source('content/js/main.js'))
        .pipe(buffer())
        .pipe(gulp.dest('build'));

I haven't investigated why this is so important yet.

@andrewfluck
Copy link

@andrewfluck andrewfluck commented Aug 18, 2016

I will definitely add that to mile gulpfile

@andrewfluck
Copy link

@andrewfluck andrewfluck commented Aug 18, 2016

My**

@golddragon007
Copy link

@golddragon007 golddragon007 commented Aug 18, 2016

I've put before every .pipe(gulp.dest(*)) the .pipe(buffer()) line, and still I get the same error. I think there's something error in the watch... because the stand alone less task works.

@edson-
Copy link

@edson- edson- commented Sep 27, 2016

We resolved this by giving read/write permissions to the Node application directory/node_modules directory. Node uses its own node_modules directory to install packages during gulp processing.

One developer had read only permissions for anything in the Program Files directory, due to accidentally getting a non-developer image from IT.

Another way to avoid this might be to install Node elsewhere - the root drive, for example.

@tegmos
Copy link

@tegmos tegmos commented Oct 3, 2016

After a couple hours of flailing about trying to fix this, finally found @cocoademon solution and it worked for me. Same issue with Vinyl/Browserify.

@chantmich
Copy link

@chantmich chantmich commented Nov 25, 2016

I've had that error while using gulp and realized that atom still had the old version of the file opened after I pulled from github.

All I had to do was close Atom and run gulp again.

Voila! no more error.

@pestbarn
Copy link

@pestbarn pestbarn commented Nov 29, 2016

Also having issues with EPERM, but only on my watch task. All tasks run fine except for this one.

Simplified gulpfile:

var gulp             = require('gulp');
var postcss          = require('gulp-postcss');
var postcss_cssnext  = require('postcss-cssnext');
var precss           = require('precss');
var postcss_magician = require('postcss-font-magician');
var clean_css        = require('gulp-clean-css');
var concat_css       = require('gulp-concat-css');
var automath         = require('postcss-automath');
var vfs              = require('vinyl-fs');
var livereload       = require('gulp-livereload');
var pump             = require('pump');

var paths = {
    css: {
        base:       './src/postcss/**/*.postcss',
        normalize:  './node_modules/normalize.css/normalize.css'
    }
};

const css = Object.keys(paths.css).map(key => paths.css[key]);

var processors = [
    postcss_cssnext,
    precss,
    postcss_magician,
    automath
];

gulp.task('css', function(callback){
    pump([
        vfs.src([css[1],css[0]]),
        postcss(processors),
        concat_css('main.min.css'),
        clean_css(),
        vfs.dest('./bin/css/'),
        livereload()
    ], callback);
});

gulp.task('watch', function() {
    livereload.listen();
    gulp.watch(css[0], ['css']);
});

Complete error message:

root@PESTBARN-PC:/mnt/f/www/v2# gulp watch
[20:24:06] Using gulpfile /mnt/f/www/v2/gulpfile.js
[20:24:06] Starting 'watch'...
[20:24:06] 'watch' errored after 27 ms
[20:24:06] Error: watch /mnt/f/www/v2/src/postcss/ EPERM
    at exports._errnoException (util.js:1026:11)
    at FSWatcher.start (fs.js:1429:19)
    at Object.fs.watch (fs.js:1456:11)
    at Gaze._watchDir (/mnt/f/www/v2/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:289:30)
    at /mnt/f/www/v2/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:358:10
    at iterate (/mnt/f/www/v2/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/helper.js:52:5)
    at Object.forEachSeries (/mnt/f/www/v2/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/helper.js:66:3)
    at Gaze._initWatched (/mnt/f/www/v2/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:354:10)
    at Gaze.add (/mnt/f/www/v2/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:177:8)
    at new Gaze (/mnt/f/www/v2/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:74:10)

This error only occurs when running on Windows (Bash). On a Unix system, it works completely fine. Also, I've checked the permissions for every file and folder in the project, which are all rwxrwxrwx.

@ForsakenHarmony
Copy link

@ForsakenHarmony ForsakenHarmony commented Dec 4, 2016

it's a bug with bash for windows fixed in build 14942

@phated
Copy link
Member

@phated phated commented Dec 4, 2016

@ForsakenHarmony do you know if that has shipped in the official channel yet?

@ForsakenHarmony
Copy link

@ForsakenHarmony ForsakenHarmony commented Dec 4, 2016

@phated going by my windows build version: No

Settings > System > About

@McQuinTrix
Copy link

@McQuinTrix McQuinTrix commented Jan 31, 2018

This might be related to permissions. I just did my gulp task with sudo and it worked perfectly.

sudo gulp

@ebitauld
Copy link

@ebitauld ebitauld commented May 23, 2018

I got the same and resolved by using gulp cache control.

I don't understand why, but it works!

Example:

var cache = require('gulp-cached');

gulp.task('cache:docsource', function(){
    return gulp.src('./app/**/*.*').pipe(cache('cacheDocSource'));
});

gulp.task('sass', function () {
  return gulp.src(''./app/scss/**/*.scss')
    .pipe(cache('cacheDocSource'))
    .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
    .pipe(gulp.dest('./dist/css'));
});

gulp.task('sass:watch', ['cache:docsource'], function () {
  gulp.watch('./app/scss/**/*.scss', ['sass']);
});
@aaronamm

This comment was marked as resolved.

@gulpjs gulpjs locked and limited conversation to collaborators Sep 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.