2016-07-19 7 views
1

vinyl-ftpをgulpで使用してFTPサーバー上のファイルをアップロードおよび更新する際に問題が発生します。vinyl-ftpでgulpにエラーが発生しました:申し訳ありませんが、クリアテキストセッションはこのサーバーで受け付けられません

マイgulpfile.jsコードは次のとおりです。

var gutil = require('gulp-util'); 
var ftp = require('vinyl-ftp'); 

gulp.task('deploy-dev', function() { 

    var conn = ftp.create({ 
     host:  'my_server_host_name', 
     user:  'my_server_username', 
     password: 'my_server_password', 
     parallel: 5, 
     log:  gutil.log 
    }); 

    var globs = [ 
     'assets/**', 
     '!node_modules/**', 
     '!assets/img/**', 
     '!assets/bower_componets/**', 
     '!assets/dist/**' 
    ]; 

    // using base = '.' will transfer everything to /public_html correctly 
    // turn off buffering in gulp.src for best performance 

    return gulp.src(globs, { base: 'assets/', buffer: false }) 
     .pipe(conn.newer('/public_html/demos/P-09-Sakha/html')) // only upload newer files 
     .pipe(conn.dest('/public_html/demos/P-09-Sakha/html')); 

}); 

// Default Task 
gulp.task('default', [ 'scripts','css','watch', 'deploy-dev']); 

そして、私の端末では、私は次のエラーを参照してください。

[16:58:12] Using gulpfile E:\xamp\htdocs\projects\P-09-sakha\html\gulpfile.js 
[16:58:12] Starting 'scripts'... 
[16:58:12] Starting 'css'... 
[16:58:12] Starting 'watch'... 
[16:58:12] Finished 'watch' after 74 ms 
[16:58:12] Starting 'deploy-dev'... 
[16:58:12] CONN 
[16:58:12] CONN 
[16:58:14] ERROR Error: Sorry, cleartext sessions are not accepted on this serve 
r. 
    at makeError (E:\xamp\htdocs\projects\P-09-sakha\html\node_modules\vinyl-ftp 
\node_modules\ftp\lib\connection.js:1067:13) 
    at Parser.<anonymous> (E:\xamp\htdocs\projects\P-09-sakha\html\node_modules\ 
vinyl-ftp\node_modules\ftp\lib\connection.js:113:25) 

を誰もがこの点で私を助けることができる場合、私は非常に義務だろう。

答えて

0

optionssecuresecureOptionsを設定してみてください:

var conn = ftp.create({ 
    host:  'my_server_host_name', 
    user:  'my_server_username', 
    password: 'my_server_password', 
    parallel: 5, 
    log:  gutil.log, 
    secure: true, 
    secureOptions: { 
     rejectUnauthorized: false 
    } 
}); 
+0

感謝はい、あなたが正しいです –

関連する問題