Answer the question
In order to leave comments, you need to log in
Gulp-ftp task should upload files to server but doesn't work?
Help with the gulp-ftp task, it should upload files to the server, but
the task itself does not work:
var gulp = require('gulp');
var autoprefixer = require('gulp-autoprefixer');
var concatCSS = require('gulp-concat-css');
var browserSync = require('browser-sync');
var rename = require('gulp-rename');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var ftp = require('gulp-ftp');
// Запускаем сервер + отлаживаем sass/html файли
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./src",
notify:false
});
gulp.watch("src/sass/.sass", ['sass']);
gulp.watch("src/.html").on('change', browserSync.reload);
});
// Компилируем sass в CSS и вставляем изминения в браузер
gulp.task('sass', function() {
return gulp.src("src/sass//*.sass")
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(concatCSS('main.css'))
.pipe(gulp.dest("src/css"))
.pipe(browserSync.stream());
});
// Загружаем файли в FailZilla
gulp.task('ftp', function () {
return gulp.src("src//*")
.pipe(ftp({
host: '123',
user: '123',
pass: '123',
remotePath: '/home/vol9_5/epizy.com/epiz_22594871'
}))
.pipe(gutil.noop());
});
gulp.task('default', ['serve']);
MacBook:good_cardboard apple$ gulp ftp
[15:07:49] Using gulpfile ~/Desktop/good_cardboard/gulpfile.js
[15:07:49] Starting 'ftp'...
(node:8332) DeprecationWarning: Ftp.raw[mkd](args): Use Ftp.raw('mkd args') instead.
(node:8332) DeprecationWarning: Ftp.raw[feat](args): Use Ftp.raw('feat args') instead.
(node:8332) DeprecationWarning: Ftp.raw[syst](args): Use Ftp.raw('syst args') instead.
(node:8332) DeprecationWarning: Ftp.raw[user](args): Use Ftp.raw('user args') instead.
(node:8332) DeprecationWarning: Ftp.raw[pass](args): Use Ftp.raw('pass args') instead.
(node:8332) DeprecationWarning: Ftp.raw[type](args): Use Ftp.raw('type args') instead.
events.js:183
throw er; // Unhandled 'error' event
^
Error: 553 Can't open that file: No such file or directory
at module.exports.Ftp.parse (/Users/apple/Desktop/good_cardboard/node_modules/jsftp/lib/jsftp.js:255:11)
at module.exports.Ftp.parseResponse (/Users/apple/Desktop/good_cardboard/node_modules/jsftp/lib/jsftp.js:171:8)
at Stream.<anonymous> (/Users/apple/Desktop/good_cardboard/node_modules/jsftp/lib/jsftp.js:139:10)
at emitOne (events.js:116:13)
at Stream.emit (events.js:211:7)
at ResponseParser.reemit (/Users/apple/Desktop/good_cardboard/node_modules/duplexer/index.js:70:25)
at emitOne (events.js:116:13)
at ResponseParser.emit (events.js:211:7)
at readableAddChunk (/Users/apple/Desktop/good_cardboard/node_modules/ftp-response-parser/node_modules/readable-stream/lib/_stream_readable.js:195:16)
at ResponseParser.Readable.push (/Users/apple/Desktop/good_cardboard/node_modules/ftp-response-parser/node_modules/readable-stream/lib/_stream_readable.js:162:10)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question