Code Monkey home page Code Monkey logo

Comments (3)

sanketbajoria avatar sanketbajoria commented on July 17, 2024

@asheikm This should have worked. This is sample code you could try

var SSH2Promise = require('ssh2-promise');

var sshconfig = {
    host: 'localhost',
    username: 'sanket',
    password: 'sanket',
    port: 8331
}

var ssh = new SSH2Promise(sshconfig);

(async function () {
    try {
        const data = await ssh.exec("apk --help");
        console.log("resp: ", data);
    } catch (e) {
        console.log("Error - " + e);
    }
})(); 

from ssh2-promise.

asheikm avatar asheikm commented on July 17, 2024

@sanketbajoria Thanks for the reply , I am on CentOS and i have to install a package through ssh.
I tried the above code with command "yum install salt-minion" ,still the issue persists.
Code is not in js but TS.

from ssh2-promise.

asheikm avatar asheikm commented on July 17, 2024

@sanketbajoria , it worked, made a mistake of written an an (async function () {}); inside an another another async function, removed the additional asycnc call solved this issue

from ssh2-promise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.