driverdan / node-XMLHttpRequest

XMLHttpRequest for node.js
http://thedanexperiment.com/2009/10/04/emulating-xmlhttprequest-in-node-js/
MIT License
416 stars 299 forks source link

Spwan ENAMETOOLONG #176

Open gwang74 opened 5 years ago

gwang74 commented 5 years ago

XMLHttpRequest throws an error 'Spawn ENAMETOOLONG' run with windows 10 while send a long string data.

var syncProc = spawn(process.argv[0], ["-e", execString]);

i think it cause by CMD arguments length limit in windows. i try to use like this

fs.writeFileSync(execFile, execString, "utf8");
var syncProc = spawn(process.argv[0], [execFile]);

is successfully run.

So could you support running with long string data in Windows?

Nvillaluenga commented 8 months ago

I have this same issue can we use something like "cross-spawn"

here for example: https://github.com/driverdan/node-XMLHttpRequest/blob/master/lib/XMLHttpRequest.js#L15