0

I specifically need to run a command with nodejs, but I cannot use child_process.spawn()

Is there a way?

nicwhitts
  • 190
  • 1
  • 3
  • 22
  • Does this answer your question? [Execute a command line binary with Node.js](https://stackoverflow.com/questions/20643470/execute-a-command-line-binary-with-node-js) – zhulien Mar 14 '21 at 14:14
  • The answers in that post all seem to use child_process.spawn() still. I know this request is a a bit strange.. – nicwhitts Mar 14 '21 at 14:25
  • There are a lot of mentions about `npm` packages that handle `shell` commands. – zhulien Mar 14 '21 at 14:30
  • And why exactly you cannot use `child_process`? @zhulien Those packages usually just wrap that internal module, adding some syntax sugar. – raina77ow Mar 14 '21 at 14:31
  • Im wrapping node within an iOS project, and iOS doesn't allow to use .spawn() – nicwhitts Mar 14 '21 at 14:43
  • @raina77ow Yes, but they're mostly using `child_process.exec()`. I am still not sure if `child_process` or `child_process.spawn()` is the problem here. – zhulien Mar 14 '21 at 14:46
  • The reason you cant use spawn is because iOS prohibits it. You will not get around this – japrescott Mar 14 '21 at 15:47
  • Yeah I’m looking for an alternative way which doesn’t use spawn due the the iOS permissions – nicwhitts Mar 14 '21 at 19:08
  • What iOS SDK are you using with node for this? Some additional tags might help get you more focused responses. – Joe Mar 14 '21 at 19:56

0 Answers0