N
N
Nikola242017-07-13 03:15:59
Node.js
Nikola24, 2017-07-13 03:15:59

Why is gulp-sftp throwing a TypeError?

I follow the example, but in the end I get an error. Tell me what's wrong

gulp.task('send', function() {
    return gulp.src('app/index.html')
        .pipe(sftp({
            host: 'host',
            user: 'user',
            pass: 'pass',
      remotePath: 'wob/public_html/'
        }));
});

Mistake:
[03:08:50] Using gulpfile E:\Front-End\wob\gulpfile.js
[03:08:50] Starting 'send'...
[03:08:50] Authenticating with password.
buffer.js:161
  throw new TypeError(kFromErrorMsg);
  ^

TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
    at Function.Buffer.from (buffer.js:161:9)
    at new Buffer (buffer.js:131:17)
    at onNEWKEYS (E:\Front-End\wob\node_modules\ssh2\lib\Connection.js:2366:29)
    at Parser.<anonymous> (E:\Front-End\wob\node_modules\ssh2\lib\Connection.js:129:5)
    at emitNone (events.js:105:13)
    at Parser.emit (events.js:207:7)
    at Parser.parsePacket (E:\Front-End\wob\node_modules\ssh2\lib\Parser.js:468:12)
    at Parser.execute (E:\Front-End\wob\node_modules\ssh2\lib\Parser.js:249:14)
    at Socket.<anonymous> (E:\Front-End\wob\node_modules\ssh2\lib\Connection.js:536:18)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at addChunk (_stream_readable.js:252:12)
    at readableAddChunk (_stream_readable.js:239:11)
    at Socket.Readable.push (_stream_readable.js:197:10)
    at TCP.onread (net.js:588:20)

Process finished with exit code 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sibkedr, 2018-05-30
@sibkedr

I have the same error, how did you solve it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question