diff --git a/lib/cli.js b/lib/cli.js index 1c9af8fa9..dce568be2 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -4,6 +4,8 @@ /* eslint no-empty:0 */ 'use strict'; +const _ = require('lodash'); + if (process.getuid && process.getuid() === 0) { global.console.error('Verdaccio doesn\'t need superuser privileges. Don\'t run it under root.'); } @@ -182,13 +184,17 @@ function afterConfigLoad() { }); // undocumented stuff for tests - if (typeof(process.send) === 'function') { - process.send({verdaccio_started: true}); + if (_.isFunction(process.send)) { + process.send({ + verdaccio_started: true, + }); } } process.on('uncaughtException', function(err) { - logger.logger.fatal( {err: err}, + logger.logger.fatal( { + err: err, + }, 'uncaught exception, please report this\n@{err.stack}' ); process.exit(255); });