gulpjs / fs-mkdirp-stream

Ensure directories exist before writing to them.
MIT License
8 stars 7 forks source link

ENOTSUP error when copying files to a fs that doesn't support chmod #18

Closed Tschrock closed 2 years ago

Tschrock commented 2 years ago

What were you expecting to happen?

The files/folders get copied from gulp.src to gulp.dest

What actually happened?

Gulp throws an error with no stacktrace.

Please give us a sample of your gulpfile

var gulp = require('gulp');

gulp.task(function copy() {
    return gulp.src('./dist/**/*').pipe(gulp.dest("/run/user/1000/gvfs/mtp:host=OnePlus_IN2025_4f28e22d/Internal shared storage/test/"));
});

Terminal output / screenshots

$ npx gulp copy
[19:52:49] Using gulpfile ~/Documents/VS_Code/testrepo/gulpfile.js
[19:52:49] Starting 'copy'...
[19:52:49] 'copy' errored after 32 ms
[19:52:49] Error: ENOTSUP: operation not supported on socket, chmod '/run/user/1000/gvfs/mtp:host=OnePlus_IN2025_4f28e22d/Internal shared storage/test/build'

Please provide the following information:

Additional information

There's no stacktrace, so I don't know where inside of gulp this is coming from, or if it's coming from one of gulp's dependencies. Somewhere, something is trying to chmod the new directories, which is failing because the filesystem doesn't support chmod. Ideally this error would be ignored - if a filesystem doesn't support chmod then there's no reason to try setting permissions.

I've tried overwriting fs.chmod with a no-op like fs.chmod = (p, m, cb) => cb(); but this had no effect.

phated commented 2 years ago

I thought we had an issue open for not supporting these types of filesystem paths in vinyl-fs or vinyl but I can't find it (only found a remote path issue). But this is a known limitation currently with no ETA on when it'll be worked on since all of our filesystem core team is unavailable for an unknown amount of time.

phated commented 2 years ago

I transferred this to our fs-mkdirp-stream repository because I believe it needs to be handled here.

I just released v2 but this might land in a v2.0.1