Skip to content Skip to sidebar Skip to footer

How To Exec In NodeJS Using The User's Environment?

I am trying to execute a command in Node: cd '/www/foo/' && '/path/to/git/bin/git.exe' config --list --global Basically, I want to execute a Git command that returns globa

Solution 1:

I solved it.

I retrieved the current environment from process.env and extended it with my own properties:

var environment = process.env;
environment.customProp = 'foo';

var config = {
    maxBuffer: 10000 * 1024,
    env: environment
};

So the problem was I missed the entire environment when I overwrote it.


Post a Comment for "How To Exec In NodeJS Using The User's Environment?"