I am trying to execute a child process in a different directory then the one of its parent.
var exec = require('child_process').exec;
exec(
'pwd',
{
cdw: someDirectoryVariable
},
function(error, stdout, stderr) {
// ...
}
);
I'm doing the above (though of course running "pwd" is not what I want to do in the end). This will end up writing the pwd of the parent process to stdout, regardless of what value I provided to the cdw option.
What am I missing?
(I did make sure the path passed as cwd option actually exists)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…