ENOENT on nonexistant glob directory with gulp v5.0.1
Author: bpfosterCreated Jun 2, 2025Updated Sep 10, 2025
Before you open this issue, please complete the following tasks:
- use the search bar at the top of the page to search this repository for similar issues or discussions that have already been opened.
- if you are looking for help from the gulp team or community, open a discussion.
- if you think there is a problem with the plugin you're using, open a discussion.
- if you think there is a bug in our code, open this issue.
What were you expecting to happen?
src glob on nonexistent directory to successfully no-op.
What actually happened?
An ENOENT error was thrown.
Please give us a sample of your gulpfile
const { src, dest } = require('gulp');
function defaultTask(cb) {
return src('input/*.js')
.pipe(dest('output/'));
}
exports.default = defaultTaskTerminal output / screenshots
Error: ENOENT: no such file or directory, scandir '/project/input'Please provide the following information:
- OS & version [e.g. MacOS Catalina 10.15.4]: RHEL 8
- node version (run
node -v): 24.0.1 - npm version (run
npm -v): 11.3.0 - gulp version (run
gulp -v): 5.0.1
Additional information
On attempting to upgrade from gulp v5.0.0 to v5.0.1, an error is thrown that was not thrown before.
In v5.0.0, if the parent directory of the glob didn't exist, nothing was copied and the gulp build proceeded without error.
In v5.0.1, an ENOENT error is now thrown, breaking the build.
Source: gulpjs/gulp