OSX: Command failed: docker -v /bin/sh: docker: command not found


#1

So I’m trying to run this shell command within my electron application to check if a user has docker installed. The command works perfectly in my dev environment but when I package the application it no longer works.

ChildProcess.execSync('docker -v', (error, stdout, stderr) => {
    if (error) {
      console.error(`exec error: ${error}`);
    }
    console.log(`stdout: ${stdout}`);
    console.log(`stderr: ${stderr}`);
  });

These are the errors I get within the electron app console:

child_process.js:538 Uncaught Error: Command failed: docker -v
/bin/sh: docker: command not found

deep-extend.js:30 Uncaught TypeError: Cannot read property _currentElement of null

I’ve tried both exec and execSync.