The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [child-process]

For questions regarding child-process

0
votes
1answer
30 views

child_process module has not been loaded yet

I'm looking into NodeJS for running a PowerShell script from my JavaScript script. This is the code I found online: var spawn = require("child_process").spawn,child; child = spawn("powershell.exe",["...
1
vote
0answers
12 views

run npm pack using child_process.exec

I'm facing some weird behavior when runing npm pack using the child_process.exec method. const { exec } = require('child_process'); function execCommand( command ) { exec( command, ( err, ...
0
votes
0answers
10 views

child_process.spawn() hangs when child process prompts for input

I've written a node script to manage deployment of a git repository to a AWS autoscaling group. The script uses child_process.spawn() to automate git, to clone repositories, checkout tags etc. It ...
0
votes
1answer
17 views

Packaged Electron app does not launch when run from Dock but works fine when run from Terminal

So this is a bit of an odd one. I have an Electron app packaged using electron-builder. The app attempts to spawn a Java process using child_process.spawn() and uses minimal-request-promise to poll ...
0
votes
1answer
36 views

Cannot kill a linux process using node js process.kill(pid)

Im trying to kill background running process using nodejs process.kill(pid, 'SIGTERM'), but the process is not getting killed. I executed node script mentioned below and later checked the process ...
1
vote
0answers
55 views

Node.js Getting error in error in child_process.spawn

i node.js (v10.15.3) I am trying to use psexec which is an exe in pstools. From node.js, I want to execute commands on remote windows server; hence using psexec.exe. Here is the code i am using, ...
0
votes
0answers
23 views

node.js stream output of command on remote windows server

I am using node.js (v10.15.3) to execute command on remote windows 8 server and want to get output of command in console. I am using below code, var Promise = require('promise'); var exec = require('...
0
votes
0answers
14 views

node.js out of memory after file upload complete

I have a web-server running on an embedded linux running on an armv7 SBC (Atmel SAMA5D27-SOM with 128MB RAM). The firmware update process requires a .tar.gz file to be uploaded via this interface, ...
0
votes
2answers
40 views

How to pass form data from child component to parent component

I want to send the form data which is in my child to parent component. On submit function I have written in Parent component. Parent Component : handleChangeValue = (e) => { this....
0
votes
0answers
27 views

Imagemagick convert failing in Firebase cloud function Spawn Child Process

I'm trying to crop images to aspect ratio 12:19 after they are uploaded to Firebase Storage using a Cloud Function that listens for new file uploads. The ImageMagic's 'convert' command works locally. ...
0
votes
1answer
11 views

Wait for all child processes to finish to continue

I would like to know if it is possible to wait for all child process created using the spawn function to finish before continuing execution. I have a code looking like this: const spawn = window....
2
votes
0answers
46 views

using of binary (golang) from nodejs application and use the output

I’ve a binary which is executable (a golang cli) which I need to call from nodejs application and get the response. for example when running the following fzr get apps it will provide list of apps ...
0
votes
0answers
8 views

child_process.execFile() function stops my process at the exact time

I am using child_process.execFile() to run a process. That process needs to run for some hours but that process is stopping at the exact time by getting a trigger from the nodejs execFile function.I ...
0
votes
1answer
51 views

Simple check in shared memory return SIGSEGV error 008b

I implemented in C a shared memory to let forked child comunicate eachother, here's a Minimal, Complete, and Verificable example: #include <stdio.h> #include <stdlib.h> #include <...
1
vote
0answers
39 views

One random child get a 008b error (segmentation fault, SIGSEGV). How to debug?

I'm creating 100 child with fork() that synchronize themselves using semaphores for a limited amount of time (10 secs), then they got killed by a kill() in the signal handler. I keep getting a SIGSEGV ...
0
votes
1answer
29 views

How does child_process behave in Nodejs

I have a working Nodejs code, however, the child_process library behaves strange, I am just wondering how this library works. My code is trying to download the SSL certificates from S3, then create ...
1
vote
2answers
39 views

Node Server Running on Ubuntu that needs to execute a C# application - how?

I have a very simple C# application that was written by a previous person. It uses the MD5CryptoServiceProvider to compute hash using some seed strings to generate a random code. I have a Node.js ...
2
votes
1answer
70 views

Controlling inheritability of file handles created by C++ std::fstream in Windows

In Windows, when creating a process with CreateProcess, one can pass true as the bInheritHandles argument. CreateProcess( , , , , bInheritHandles, , , , ) This means that all file handles marked to ...
0
votes
0answers
89 views

Get all processes in a program's domain

I'm trying to get all the processes within a domain, kind of like Process Explorer - Sysinternals does. I am trying it with C#.NET (framework 2.0). I tried using, AppDomain.CurrentDomain....
1
vote
1answer
53 views

Having trouble with waiting a child process with another child process in c++

I'm having trouble with controlling three child processes' output order in my c++ assignment. So the requirement of the assignment is to create three child processes. A, B and C. Which I can ...
1
vote
1answer
22 views

How to change signal handler in child-process?

I'm writing a shell with job control. The main process should ignore stop-signals and handle SIGCHLD. Child process after fork() should set signals to SIG_DFL. The problem is that my child process ...
0
votes
0answers
16 views

Certain Arguments won't work with childProcess.spawn()

I can only send over some of my arguments, the -u and -v crash my app, I'm able to run all of them in the powershell directly but when trying to provoke from node it doesn't run. If i take those two ...
0
votes
0answers
9 views

How can I create a CLI “watch” command using “fs.watch()” and “child_process”?

I am currently building a CLI, it has a "watch" function/command that fires a function whenever a given file is changed. However, I need this "watch" function to run on a separate process because I do ...
0
votes
0answers
77 views

Include exe used in child process

I am spawning a child process with the path defined as private readonly executablePath = path.join(__static, '/game/ArcMages.exe'); (This is in vue electron). I put the exe under public/. Once the ...
-1
votes
0answers
13 views

how to ssh using the spawn command into a remote server getting spawn ssh ENOENT

I am using ssh to login into the remote server using spawn. getting error I have replaced ssh with /usr/bin/ssh let child = spawn('/bin/ssh') child.stdout.on('data', function(data) { ...
0
votes
1answer
55 views

Getting the progress output of a child spawned process from nodejs

I'm playing in spawning npm install -g create-react-app from a js script. I want to get in real time the part of the output, where you can see the progress of the package's installation process. I ...
0
votes
2answers
24 views

Killing a node.js server (launched in jest's setup hook) in jest teardown

I'm using Jest as a testing library and inside its setup hook (which is executed before all my tests), I spawn a child process which launches a testing server on a certain port. The setup code ...
1
vote
0answers
52 views

It is possible to get the progress of a spawned process from nodejs?

I'm spawning npm install -g create-react-app from a js script. I want to know if it's possible to get the progress of the installation using spawn. const npmExecutable = /^win/.test(process.platform) ...
0
votes
0answers
20 views

How do I create child processes in my index.js on Express?

I am currently using Angular for my front end and Express for my back end of my site. Users can submit calls on Angular which trigger and http request to my express server which then submit to our ...
1
vote
1answer
23 views

How can I kill a child process without the child process 'exit' event triggering?

I'm spawning a child process: child = spawn("childprocess", [], { detached: true } And I'm watching the 'exit' event with: child.on('exit', (code, signal) => { // Do stuff } When my app ...
0
votes
1answer
21 views

Quit application, update data, and open again, in nodejs

How can I close my application on nodejs, and then reopen? Can I do with SPAWN (child_process)? I need to close the application, perform the update on the data, and then open the application again. ...
0
votes
1answer
16 views

NodeJS — Fork Child Process with function string instead of file

I've looked at the documentation for the fork method, and it only describes providing a file path to the child module file. Does anyone know if it is possible (and undocumented) to pass in the child ...
0
votes
0answers
19 views

InstallShield set environment variable for child installation

I have an installation that launches a child installation of a 3rd party tool. The launching is done with LaunchAppAndWait() in a .rul file. The 3rd party installation needs an environment variable ...
0
votes
0answers
33 views

How to execute R script from an Angular app

I'm trying to link two existing projects. An Angular 7 web application and existing R-scripts. I already tried npm i r-script --save in the angular project. Addtionally I installed @types/r-script as ...
0
votes
0answers
46 views

Is there a way to use cocoasudo (graphical “sudo” for Mac OS X) in Electron/Node app?

I am spawning a child process with root privileges in my Electron app for macos. Things are working fine but app is asking for root password on command line instead of user interface. var cProcess = ...
0
votes
0answers
23 views

Switching user in node spawn child processes

How can one change a child processes' uid/gid based on a user-supplied username and password without granting node root or other special privileges? Basically the child process equivalent of: su ...
0
votes
0answers
20 views

How to catch ENOENT error when spawning a child process in node.js on Windows, without using “shell: true”

I'm trying to create a child process, using spawn, and would like to be able to handle if the "cwd" is not found. When it's not found, it throws an "ENOENT" error, which on Windows I can only seem to ...
0
votes
1answer
33 views

NodeJS child_process ansi in stdout

I want to get something like [06:32:35] [Server thread/INFO]: [0;36;1m | [0;36;22m|__) [0;32;22mLuckPerms [0;36;1mv4.3.73[m [06:32:35] [Server thread/INFO]: [0;36;1m |___ [0;36;22m| [0;30;...
1
vote
2answers
134 views

C: why after fork() child block is not running?

I'm studying how fork() actually works so my code below has no purpose other than spawning new processes with fork() and see them die randomly. So: I put my fork() in a for loop (to run twice for now)...
0
votes
0answers
16 views

Start a child_process minimized to system tray

I'm making a script that starts and then closes a program to get something from a log, but I need it to start to system tray (Or at least minimized) Is this possible? var child = require('...
0
votes
2answers
54 views

sls offline - invoke an AWS.Lambda function from within another lambda function in local machine (In nodejs)

I have a problem facing to invoke an AWS.Lambda function from within another lambda function in local machine by using sls offline Could anyone can help me on this I aleady try with child_process(...
0
votes
1answer
21 views

node js childprocess python geojson as paramater

I am doing an sql query on my postgis database in node.js which returns a GEOJSON object. I want to pass that GEJSON (as a string) to a python child process on the same server: var spawn = require("...
0
votes
0answers
29 views

Spawning multiple child processes to preview Vue.js projects

Context: I'm making a Codepen-like app but I want it to support sophisticated JS libraries/frameworks like Vue or Angular 2+ for example. I want to have a live preview of my snippet which updates in a ...
0
votes
0answers
24 views

Use pm2 start a node app, that node app forks a child process, when the child process is down, Will pm2 restart the node app?

Here is my problem that I have met. There are three files in my node project named app.js, app-8080.js, app-8090.js. The three files are almost the same except the port. In app.js server.listen(...
-1
votes
1answer
31 views

Kill (like ctrl+c) exec (child process) on nodejs

I have the following code in index.js: var child = exec( 'node app.js --board=' + data.data.board + ' --link=' + data.data.link, function (error, stdout, stderr) { if (error) console....
0
votes
0answers
34 views

How can I ask password from user in interactive way instead of on command-line when using node packages?

While spawning a child process with sudo, I want to ask for password as a prompt like sudo-prompt does. But require('child_process').spawn is asking for password on terminal. Here is my code: var ...
0
votes
1answer
58 views

Node.js child process to Python process

I must send text from a node.js child process to a python process. My dummy node client looks like var resolve = require('path').resolve; var spawn = require('child_process').spawn; data = "lorem ...
1
vote
1answer
35 views

Call a function inside its own callback

My NodeJS application runs my C++ application and watches it. If application gets killed, server runs it again. If my application would run for days, will it cause stack overflow if hypothetically ...
0
votes
1answer
11 views

windows nodejs child_process exec echo always print childProcess instance

like this: I has try with cmd.exe, powershell.exe, git-bash.exe, both of them have this behavior. Why?
0
votes
1answer
21 views

Piping a dockerfile string to `docker build` from Node.js is not working

I am trying to pipe a Dockerfile to docker build via stdin as mentioned here: https://docs.docker.com/engine/reference/commandline/build/#specify-a-dockerfile--f I have tried everything, and Docker ...