Welcome to the Linux Foundation Forum!

CH.15 Lab.1 - spawn Unknown system error -8

First I ran into EACCES error and had to add execute permissions to the files in the folder. Now I'm wondering if this is a similar permission error the spawn throws when trying to spawn the process.

index.js

  1. function exercise (myEnvVar) {
  2. const process = spawn(child_path, [], { env: { MY_ENV_VAR: myEnvVar } })
  3.  
  4. return process
  5. }

test.js

  1. sp = exercise(value)
  2. sp.on('error', (err) => { throw err })

Error

  1. if (status == null) throw err
  2. ^
  3.  
  4. Error: spawn Unknown system error -8
  5. at ChildProcess.spawn (node:internal/child_process:421:11)
  6. at spawn (node:child_process:761:9)
  7. at exercise (/Users/karlonauger/code/my-package/labs/ch-15/labs-1/index.js:22:19)
  8. at Object.<anonymous> (/Users/karlonauger/code/my-package/labs/ch-15/labs-1/test.js:12:8)

Answers

  • Perhaps -8 means ENOEXEC (Executable file format error). I wonder what value does child_path hold.

  • Posts: 160

    there's not enough info about the file system to debug this, generally it seems like a filesystem issue though

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training