Advertisement
Guest User

Untitled

a guest
May 30th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. var node_ssh, ssh;
  2.  
  3. node_ssh = require('node-ssh');
  4. ssh = new node_ssh();
  5.  
  6. ssh.connect({
  7. host: 'host',
  8. username: 'username',
  9. password: 'password'
  10. }).then(function() {
  11. ssh.execCommand('ls', {cwd:'/root/softwares', stream:'both'}).then(function(result) {
  12. console.log('STDOUT: ' + result.stdout);
  13. console.log('STDERR: ' + result.stderr);
  14. });
  15. });
  16.  
  17. D:node_ssh_testnode_modulesnode-sshnode_modulesjs-toolkitdistmain.js:21
  18. promisified.prototype = callback.prototype;
  19. ^
  20. TypeError: Cannot read property 'prototype' of undefined
  21. at promisify (D:node_ssh_testnode_modulesnode-sshnode_modulesjs-toolkitdistmain.js:21:35)
  22. at Object.<anonymous> (D:node_ssh_testnode_modulesnode-sshDistSSH.js:18:39)
  23.  
  24. at Module._compile (module.js:456:26)
  25. at Object.Module._extensions..js (module.js:474:10)
  26. at Module.load (module.js:356:32)
  27. at Function.Module._load (module.js:312:12)
  28. at Module.require (module.js:364:17)
  29. at require (module.js:380:17)
  30. at Object.<anonymous> (D:node_ssh_testtest.js:3:12)
  31. at Module._compile (module.js:456:26)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement