$this->getNodeEnv()], null, null ); $output = ''; $exit = $process->run(function ($status, $stdout) use (&$output) { $output .= $stdout; }); $output = trim($output); // Npm failed for some reason, report to user if ($exit !== 0) { $this->error('NPM exited with error: ' . $output); return $exit; } // Report the version to user if (!$this->option('silent')) { $this->info($output); } // If the user has not requested a compatibility check, then return 0 if (!$this->option('compatible')) { return 0; } // If the version of npm is less than the required minimum, then return fail if (version_compare($output, static::NPM_MINIMUM_SUPPORTED_VERSION, '<')) { return 1; } return 0; } }