An ENOENT error in child_process.spawnSync()

378 views Asked by At

I'm trying to run a .cpp file with spawnSync(command, args, options), but i'm getting a following error:

Error: spawnSync ./hello.out ENOENT

spawnSync arguments are:
command: g++
args: [ 'hello.cpp', '-o', 'hello.out' ]
options: { input: '', timeout: 2000, cwd: '../cppFileIsHere' }

From the other questions about this error i got that it can't find a "hello.out" file in the "/cppFileIsHere" directory, but it's located right there

I've tried moving it into the root directory and in the same folder with .js code which spawns process but i still get the same error. How can it be fixed?

0

There are 0 answers