Gulp: Gulp 4: The value of "mode" is out of range. Received 33279"

Created on 16 May 2018  路  9Comments  路  Source: gulpjs/gulp

I have a gulpfile.js in the top level of the project and then I have my tasks split into files in a gulp/tasks. Running the gulpfile.js from the project root with the source files in src/* directory

What were you expecting to happen?s
When running from the root directory I expect to pass the full [relative] path to the gulp.src method.

What actually happened?

RangeError [ERR_OUT_OF_RANGE]: The value of "mode" is out of range. Received 33279
at Object.fs.fchmod (fs.js:1024:11)
at Object.fchmod (/www/gaiatools.com/node_modules/graceful-fs/polyfills.js:237:17)
at mode (/www/gaiatools.com/node_modules/vinyl-fs/lib/file-operations.js:237:10)
at onStat (/www/gaiatools.com/node_modules/vinyl-fs/lib/file-operations.js:227:14)
at /www/gaiatools.com/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:150:5)

It seems Gulp is starting in the src directory, because when I remove the src prefix from the path it works as expected. The paths weren't an issue prior to upgrading to Gulp 4

In another project having src at the front of the path doesn't cause issues. So I'm at a loss for why it's an issue in this project.

Please post a sample of your gulpfile (preferably reduced to just the bit that's not working)

// /gulpfile.js
var requireDir = require ( 'require-dir' );
requireDir ( './gulp/tasks', {
    recurse : true,
} ); // no difference if I use require('./gulp/tasks/copy')

// gulp/tasks/copy.js file
gulp.task('copy', css);

function css() {
    return gulp.src(['src/css/*.css'])
        .pipe(gulp.dest( 'web/css' ));
}

Then I run it from the command line gulp copy This isn't the only task that has this issue either. My Sass compiler task has the same issue when src is prefixed to the front of the path. I just used this one because it's less lines and doesn't use any plugins

What version of gulp are you using?
Gulp 4

What versions of npm and node are you using?
node v10
npm v6

solved

Most helpful comment

This is a Node 10 bug (https://github.com/nodejs/node/issues/20498).

It should be fixed soonish. Revert to Node 9 or wait for their fix.

All 9 comments

This is a Node 10 bug (https://github.com/nodejs/node/issues/20498).

It should be fixed soonish. Revert to Node 9 or wait for their fix.

I have the same problem except that in my case
When there are too many files of entries to treat in my task of minification it shows me this error

RangeError [ERR_OUT_OF_RANGE]: The value of "mode" is out of range. Received 33279
at Object.fs.fchmod (fs.js: 1024: 11)
at Object.fchmod (/Users/frederic/Documents/workspace-angular-js/ipCentrexResiliationUi/node_modules/graceful-fs/polyfills.js:237:17)
at mode (/Users/frederic/Documents/workspace-angular-js/ipCentrexResiliationUi/node_modules/gulp/node_modules/vinyl-fs/lib/file-operations.js:237:10)
at onStat (/Users/frederic/Documents/workspace-angular-js/ipCentrexResiliationUi/node_modules/gulp/node_modules/vinyl-fs/lib/file-operations.js:227:14)
at /Users/frederic/Documents/workspace-angular-js/ipCentrexResiliationUI/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js: 150: 5)

Thank you for helping me understand what's wrong I remember that I use

Node 10 & Gulp 4

Still have this issue in 10.3.0

RangeError [ERR_OUT_OF_RANGE]: The value of "mode" is out of range. Received 33204
    at Object.fs.fchmod (fs.js:1056:11)
    at Object.fchmod (/workspace/node_modules/graceful-fs/polyfills.js:237:17)
    at mode (/workspace/node_modules/vinyl-fs/lib/file-operations.js:237:10)
    at onStat (/workspace/node_modules/vinyl-fs/lib/file-operations.js:227:14)
    at /workspace/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:183:5)

@klimashkin please don't "update" us on the fact that node still hasn't fixed their issue... It just adds yet-more noise to our lives.

According to their changelog at https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V10.md#10.5.0 - it seems that node 10.5 (released on 6-20-18) has finally landed this fix.

I'm unlocking this to get feedback on if this node problem is fixed for you so I can close the issue.

@phated Yes. 10.5.0 is the first version after 10.0.0 where CI pipeline finished successfully.

I encountered this error on node v10.3.0. However after seeing this thread and upgrading to v10.5.0, the error has gone away and everything works fine. It was probably it. (Thought i'd let you and future visitors in this thread know)

I also confirm that I no longer encounter this error after updating to Node 10.5.0.

Thanks all for letting us know. I'm going to close this now.

Was this page helpful?
0 / 5 - 0 ratings