gulp-ssh icon indicating copy to clipboard operation
gulp-ssh copied to clipboard

gulp-ssh not working anymore

Open senthanal opened this issue 11 years ago • 14 comments

Hi, gulp-ssh was working without troubles but after running npm install(npm install) breaks with error.


_stream_writable.js:313
    cb(er);
    ^
TypeError: object is not a function
    at onwriteError (_stream_writable.js:313:5)
    at onwrite (_stream_writable.js:335:5)
    at WritableState.onwrite (_stream_writable.js:105:5)
    at c:\_projekte\Products\WIGeoWeb3_ANWR\node_modules\gulp-ssh\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:2752:14
    at state.requests.(anonymous function).cb (c:\_projekte\Products\WIGeoWeb3_ANWR\node_modules\gulp-ssh\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:960:15)
    at SFTPStream._cleanup (c:\_projekte\Products\WIGeoWeb3_ANWR\node_modules\gulp-ssh\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:190:38)
    at SFTPStream.end (c:\_projekte\Products\WIGeoWeb3_ANWR\node_modules\gulp-ssh\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:160:8)
    at SFTPWrapper.end (c:\_projekte\Products\WIGeoWeb3_ANWR\node_modules\gulp-ssh\node_modules\ssh2\lib\SFTPWrapper.js:29:23)
    at WriteStream. (c:\_projekte\Products\WIGeoWeb3_ANWR\node_modules\gulp-ssh\index.js:175:20)
    at WriteStream.emit (events.js:129:20)

Seems like problem comes from the ssh2 node module. Any help would be great! Thanks for the nice gulp plugin :)

senthanal avatar Sep 13 '15 05:09 senthanal

I think, I found the answer. gulp-ssh works with ssh2-streams version 0.0.15 but not with 0.0.16 which is the latest as of I see from the dependency list of gulp-ssh. Could it be?

senthanal avatar Sep 13 '15 05:09 senthanal

I have updated dependencies version. is it work for you?

zensh avatar Sep 13 '15 08:09 zensh

same problem here: _stream_writable.js:313 cb(er); ^ TypeError: object is not a function at onwriteError (_stream_writable.js:313:5) at onwrite (_stream_writable.js:335:5) at WritableState.onwrite (_stream_writable.js:105:5) at /Users/roberto/web/sautil.com.br/api/gulp/node_modules/gulp-ssh/node_modules/ssh2/node_modules/ssh2-streams/lib/sftp.js:2752:14 at state.requests.(anonymous function).cb (/Users/roberto/web/sautil.com.br/api/gulp/node_modules/gulp-ssh/node_modules/ssh2/node_modules/ssh2-streams/lib/sftp.js:960:15) at SFTPStream._cleanup (/Users/roberto/web/sautil.com.br/api/gulp/node_modules/gulp-ssh/node_modules/ssh2/node_modules/ssh2-streams/lib/sftp.js:190:38) at SFTPStream.end (/Users/roberto/web/sautil.com.br/api/gulp/node_modules/gulp-ssh/node_modules/ssh2/node_modules/ssh2-streams/lib/sftp.js:160:8) at SFTPWrapper.end (/Users/roberto/web/sautil.com.br/api/gulp/node_modules/gulp-ssh/node_modules/ssh2/lib/SFTPWrapper.js:29:23) at WriteStream. (/Users/roberto/web/sautil.com.br/api/gulp/node_modules/gulp-ssh/index.js:175:20) at WriteStream.emit (events.js:129:20)

betorobson avatar Sep 14 '15 23:09 betorobson

It is bug comes from [email protected], [email protected] work well. @mscdex

zensh avatar Sep 15 '15 03:09 zensh

Could you help me? What do I need to do?

betorobson avatar Sep 15 '15 03:09 betorobson

You can cd gulp-ssh/node_modules/ssh2 && npm i [email protected]

zensh avatar Sep 15 '15 03:09 zensh

I will try to fix ssh2-streams some time later

zensh avatar Sep 15 '15 03:09 zensh

Hello, let me know if this patch on top of master fixes things for you or not. Either way, it'd be good to have a test case for this.

mscdex avatar Sep 15 '15 04:09 mscdex

@monkerek The patch work fine in gulp-ssh

zensh avatar Sep 15 '15 04:09 zensh

OK, [email protected] it's working for me now. I made a postinstall file to fix it. It will install 0.0.15 after install package.json project.

Create a file called postinstall.js and copy the content bellow:

var exec = require('child_process').exec;
exec(
    'cd node_modules/gulp-ssh/node_modules/ssh2 && npm i [email protected]',
    function (err, stdout, stderr) {
        console.log(stdout);
        console.log(stderr);
    }
);

Add into your package.json this:

  "scripts": { 
    "postinstall" : "node ./postinstall.js"
  }

Run the install command again

$ npm install

betorobson avatar Sep 15 '15 04:09 betorobson

@betorobson This issue will soon be fixed, @mscdex is ssh2's author

zensh avatar Sep 15 '15 04:09 zensh

That is grate, until it be fixed, I made the postinstall script for some members of my team which are not able to run some gulp taks that need sftp method working properly.

I'm waiting for this fix, thank you :)

betorobson avatar Sep 15 '15 04:09 betorobson

I've published a new version of ssh2-streams that has the fix I previously linked to.

mscdex avatar Sep 17 '15 04:09 mscdex

Thank you mscdex, it is working perfect. It solved my issue :)

betorobson avatar Sep 21 '15 15:09 betorobson