message: Remove then promise code, add try catch while loading dependencies
diff: -const dependencyCheck = require('check-dependencies')
  -const logger = require('../logger')
  -const colors = require('colors/safe')
  +let dependencyChecker = {}
  +let logger = {}
  +let colors = {}
  +
  +try {
  + dependencyChecker = require('check-dependencies')
  + logger = require('../logger')
  + colors = require('colors/safe')
  +} catch (err) {
  + console.log('Dependencies could not be checked due to "' + err.message + '" error (NOT OK)')
  + process.exit(1)
  +}
  const validateDependencies = async ({ exitOnFailure = true } = {}) => {
  let success = true
  - await dependencyCheck().then((val) => {
  - if (val.depsWereOk === true) {
  + let dependencies = {}
  + try {
  + dependencies = await dependencyChecker()
  + } catch (err) {
  + logger.warn(`Dependencies could not be checked due to "${err.message}" error (${colors.red('NOT OK')})`)
  + }
  +
  + if (dependencies.depsWereOk === true) {
  logger.info(`All dependencies are satisfied (${colors.green('OK')})`)
  } else {
  logger.warn(`Dependencies are not rightly satisfied (${colors.red('NOT OK')})`)
  success = false
  - for (var i in val.error) {
  - console.log(val.error[i])
  + for (let err of dependencies.error) {
  + console.log(err)
  }
  }
  - }, (err) => {
  - logger.warn(`Dependencies could not be checked due to "${err.message}" error (${colors.red('NOT OK')})`)
  - })
  if (!success && exitOnFailure) {
  logger.error(colors.red('Exiting due to unsatisfied dependencies!'))
  