U
U
Umid2017-09-03 14:27:15
Node.js
Umid, 2017-09-03 14:27:15

Why doesn't child_process work?

6452d2d17b474d97936a7c35e9530d63.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vahe, 2017-09-03
@DarCKoder

var cp = require("child_process").exec;

cp("pwd", function(error, stdout, stderr) {
    if (error !== null) console.error(error);
    console.log(`pwd => ${stdout}`);
});

d6c32722b0cc4247be19860f184bdbb0.png

S
Soslan Aldatov, 2017-09-03
@sptm

Specify the full path to pwd. If I'm not mistaken, child_process.spawn() ignores PATH under Windows.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question