I'm trying to get some simple gulp-ftp commands to work, but I keep getting an error when I run the task in some instances that I can't quite seem to figure out. I've created the task uploadCSS
using gulp-ftp - all it does is upload my site's .css files to the css folder.
The task uploadCSS
runs absolutely fine when the folder doesn't exist, without any errors. The folder is created on my sever and all the files are in there. However when the folder already exists (i.e. I want to update those files), I receive this error:
[11:33:33] Using gulpfile ~/Desktop/jm_site/gulpfile.js
[11:33:33] Starting 'uploadCSS'...
events.js:85
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:746:11)
at TCP.onread (net.js:559:26)
I've included this task in the watch task, so I need it to be able to update my site's css as changes are made. Gulp is already compiling my sass to css, then concatenating any remaining css in my local css folder and minifying it into one main file. I need gulp to watch the css as well as the sass, and then upload that new minified css file to the css folder once it changes.
uploadCSS
Task from gulpfile.js
:
gulp.task('uploadCSS', function () {
return gulp.src('css/*.css')
.pipe(ftp({
host: 'HOST',
user: 'USER',
pass: 'PASS',
remotePath: 'css'
}))
.pipe(gulp.dest('css'));
});
Any insight? I am a bit new to gulp so I apologize in advance if I'm just doing something silly in my code. I've search around but could only find similar issues with vinyl-ftp.