Skip to content

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

Closed
@KnightYoshi

Description

@KnightYoshi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions