child-process Questions

5

I need to start the bash terminal, sequentially execute several commands, collect their results and quit. What is the correct way to do this in nodejs? I tried to achieve this with child_process.sp...
Trousseau asked 4/1, 2022 at 13:0

1

I have a fairly simple C++ program which only takes one argument that is a Base64 encoded string. I can call the program. I am now trying to call this program using Node.js' child_process.spawn(), ...
Talie asked 27/3, 2016 at 19:34

5

Solved

I have a little Grunt task that shells out via node and runs "composer install". var done = this.async(); var exec = require('child_process').exec; var composer = exec( 'php bin/composer.phar in...
Deth asked 16/9, 2013 at 10:13

3

I want to run a command in command-prompt using nodejs. Based on https://dzone.com/articles/understanding-execfile-spawn-exec-and-fork-in-node, i used child_process.execFile('protractor', ['./src...
Adjustment asked 27/9, 2017 at 10:41

2

Solved

Here's a simple program that registers two trap handlers and then displays them with trap -p. Then it does the same thing, but in a child background process. Why does the background process ignore...
Shiprigged asked 5/9, 2017 at 19:1

1

I have this function and fork a child process to run a heavy work on background. The work module sends message after it completes the work. How do I kill or close the forked process? function doW...
Fcc asked 21/1, 2017 at 8:50

4

When spawning a new child in nodejs on windows (child_process.spawn) it always opens a blank console window which stays open until the child process ends. Is there a way to avoid this? i.e. we w...
Marielamariele asked 15/7, 2015 at 15:37

0

I'm trying to give a child process a name but I don't know how to do it const exec = require('child_process').exec; let cpr = exec('node server.js'); I'm using the exec function to run the child ...
Kenzi asked 29/7, 2021 at 20:28

2

Solved

I am trying to spawn an external process phantomjs using node's child_process and then send information to that process after it was initialized, is that possible? I have the following code: var sp...
Kellyekellyn asked 5/11, 2012 at 10:39

3

Solved

I have a .NET class library that spins up a secondary process which is kept running until I dispose of the object. Due to some occurances of the program lingering in memory, I've decided to add an...
Cypripedium asked 25/8, 2011 at 10:52

1

I'm attempting to do something I think is very simple -- execute an 'echo' line using child_process.exec. My code looks as such: var exec = require('child_process').exec; exec('echo "HELLO"', fun...
Boyt asked 19/6, 2014 at 18:1

3

I was just experimenting worker process hence try this: const http = require("http"); const cluster = require("cluster"); const CPUs = require("os").cpus(); const numC...
Ender asked 20/1, 2021 at 14:16

1

Solved

Within an electron.js app I'm trying to call and execute a python script from node.js based on the these indicatins: https://nodejs.org/api/child_process.html#child_process_child_process_execfile_f...
Bashan asked 19/1, 2021 at 17:44

2

I execute several processes using spawn() from child_process. const { spawn } = require('child_process'); spawn("sh", ["script1.sh"], { shell: false, stdio: "inherit"...
Hampden asked 1/12, 2020 at 14:23

4

Solved

How to exec continuously? e.g. ls after cd? I tried exec = require('child_process').exec; exec('cd ~/', function(){ exec('ls'), function(err, stdout, stderr){ console.log(stdout); // this lo...
Borkowski asked 20/1, 2013 at 17:18

3

Solved

When a child process forked from a parent dies, it still exists to some extent and is left in a zombie state, until it is reaped from a wait() call. Is is possible to detach this parent-child rela...
Hervey asked 7/10, 2017 at 14:44

2

Solved

#include <stdio.h> #include <unistd.h> int do_fork(int depth) { if (!depth) { return fork(); } int val = do_fork(depth - 1); printf("%d\n", val); return val; } int ...
Cadwell asked 4/9, 2020 at 21:53

2

Solved

I am trying to execute some line using node js child process and getting error. Following is my code: let cmd : string = "code " + PROJECTS[value]; exec(cmd, function callback(error, stdout, stder...

2

I am new to child_process and I want to experiment with its capabilities. Is there any way to pass a function and arguments to a python file, using spawn (or exec or execFile is spawn cannot do it)...
Anderer asked 17/7, 2020 at 21:19

3

I'm writing a Yeoman generator and using child_process.spawn() (via yeoman's spawnCommand() - see https://github.com/yeoman/generator/blob/master/lib/actions/spawn_command.js) My code looks like t...
Sidman asked 5/1, 2015 at 19:12

2

Solved

I'm writing a CLI using node and I've arrived at the part where I take user input and append it to a string that is the command for the child_process.exec function. const CURL_CHILD = exec('npm vi...
Froebel asked 27/3, 2018 at 12:2

1

Solved

I have a web server using NodeJS - Express and I have a Scikit-Learn (machine learning) model pickled (dumped) in the same machine. What I need is to demonstrate the model by sending/receiving dat...
Gastronome asked 5/3, 2017 at 16:2

1

I have a Node app which uses the fork method to run a background process. The problem is that running the web pack configuration from the index doesn't bundle the background process's files resulti...
Terrilynterrine asked 14/7, 2017 at 16:18

5

Solved

How to debug child Node.JS process in VS Code? Here is the example of the code that I'm trying to debug: var spawn = require('child_process').spawn; var scriptPath = './child-script.js'; var runne...
Manteau asked 16/9, 2015 at 18:16

3

My goal is to control buffering of child process when executed with execvp. More precisely, I want to redirect stdout and stderr to the same file descriptor (this is wanted behaviour, I cannot chan...
Vasileior asked 14/4, 2020 at 17:59

© 2022 - 2024 — McMap. All rights reserved.