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\',
The option is short for current working directory, and is spelled cwd, not cdw.
cwd
cdw
var exec = require('child_process').exec; exec('pwd', { cwd: '/home/user/directory' }, function(error, stdout, stderr) { // work with result });