Answers for "nodejs bash"

13

linux install node

sudo apt install nodejs
Posted by: Guest on April-28-2020
6

how to install node js in ubuntu

//Author: Mohammad Arman Khan
//How To Install Node.js on Ubuntu
1: sudo apt-get update
2: sudo apt-get install nodejs
3: sudo apt-get install npm
4: nodejs -v
Posted by: Guest on January-07-2021
6

node run shell command

// You can use 'exec' this way

const { exec } = require("child_process");

exec("ls -la", (error, stdout, stderr) => {
    if (error) {
        console.log(`error: ${error.message}`);
        return;
    }
    if (stderr) {
        console.log(`stderr: ${stderr}`);
        return;
    }
    console.log(`stdout: ${stdout}`);
});
Posted by: Guest on April-20-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language