diff --git a/lib/child_process.js b/lib/child_process.js index a37d2f2d412..6a6c61cf248 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -1264,6 +1264,7 @@ function spawnSync(/*file, args, options*/) { options.file = opts.file; options.args = opts.args; + options.envPairs = opts.envPairs; if (options.killSignal) options.killSignal = lookupSignal(options.killSignal); diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 647ce850207..bb5c606afce 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -736,9 +736,9 @@ int SyncProcessRunner::ParseOptions(Local js_value) { r = CopyJsStringArray(js_env_pairs, &env_buffer_); if (r < 0) return r; - uv_process_options_.args = reinterpret_cast(env_buffer_); - } + uv_process_options_.env = reinterpret_cast(env_buffer_); + } Local js_uid = js_options->Get(env()->uid_string()); if (IsSet(js_uid)) { if (!CheckRange(js_uid))