Search code examples
node.jsunixnpmsshscp

Is there a way to expose debug lines during scp2 upload operation in nodejs?


I am using this package in a nodejs app: https://www.npmjs.com/package/scp2 and it is calling upload(src, dest) to a unix server. It is not connecting to the unix server and the only error I see is Exit code 255 while establishing SFTP session. I realize it is not connecting due to something on the Unix servers OpenSSL package changing but since its rollback, it is still not working as it was before.

Is there a way to display the debug lines for scp2.upload()? I am stepping through the scp2 package in vscode debug mode but not finding anything.


Solution

  • I added this in the scp2 configs: debug: console.log as such:

      this.sshCreds = {
    host: this.host,
    username: this.username,
    password: this.password,
    debug: console.log,
    };
    
    this.sshClient = new SshClient(this.sshCreds);