5

I have a node server that runs on debian and I'm trying to pass data extracted from a file into the command line using exec().

getconf ARG_MAX = 2097152 bytes (2 mb)

myFile = 600 kb (contains 600kb worth of parameters)

When I call exec() command from node:

Error: spawn E2BIG
at ChildProcess.spawn (internal/child_process.js:372:11)
at spawn (child_process.js:543:9)
at Object.execFile (child_process.js:221:15)
at exec (child_process.js:152:18)
at Promise (child_process.js:160:15)
at new Promise () at args (child_process.js:159:12)

Shouldn't it work since getconf ARG_MAX is bigger than the data I'm trying to pass?

vinS
  • 1,417
  • 5
  • 24
  • 37

0 Answers0