diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index bcaab11..be54e92 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -520,7 +520,8 @@ exports.XMLHttpRequest = function () { const output = require('child_process').execSync(`"${process.execPath}" "${scriptPath}" \ --ssl="${ssl}" \ --encoding="${encoding}" \ ---request-options=${JSON.stringify(JSON.stringify(options))}`, { stdio: ['pipe', 'pipe', 'pipe'], input: data, maxBuffer: maxBuffer }) +--request-options=${JSON.stringify(JSON.stringify(options))} \ +--ms-enable-electron-run-as-node`, { stdio: ['pipe', 'pipe', 'pipe'], input: data, maxBuffer: maxBuffer, env: { ...process.env, ELECTRON_RUN_AS_NODE: true } }) const result = JSON.parse(output.toString('utf8')) if (result.error) { throw translateError(result.error, url)