diff --git a/lib/API/Extra.js b/lib/API/Extra.js index 4271a58dc..e30aba121 100644 --- a/lib/API/Extra.js +++ b/lib/API/Extra.js @@ -100,6 +100,7 @@ module.exports = function(CLI) { var Log = require('./Log'); that.Client.executeRemote('getReport', {}, function(err, report) { + console.log() console.log() console.log() @@ -107,16 +108,19 @@ module.exports = function(CLI) { fmt.title('PM2 report') fmt.field('Date', new Date()); fmt.sep(); - fmt.title(chalk.bold.blue('Daemon')); - fmt.field('pm2d version', report.pm2_version); - fmt.field('node version', report.node_version); - fmt.field('node path', report.node_path); - fmt.field('argv', report.argv); - fmt.field('argv0', report.argv0); - fmt.field('user', report.user); - fmt.field('uid', report.uid); - fmt.field('gid', report.gid); - fmt.field('uptime', dayjs(new Date()).diff(report.started_at, 'minute') + 'min'); + + if (report && !err) { + fmt.title(chalk.bold.blue('Daemon')); + fmt.field('pm2d version', report.pm2_version); + fmt.field('node version', report.node_version); + fmt.field('node path', report.node_path); + fmt.field('argv', report.argv); + fmt.field('argv0', report.argv0); + fmt.field('user', report.user); + fmt.field('uid', report.uid); + fmt.field('gid', report.gid); + fmt.field('uptime', dayjs(new Date()).diff(report.started_at, 'minute') + 'min'); + } fmt.sep(); fmt.title(chalk.bold.blue('CLI'));