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
  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 (let err of dependencies.error) {
      console.log(err)
    }
  }

  if (!success && exitOnFailure) {
    logger.error(colors.red('Exiting due to unsatisfied dependencies!'))
    process.exit(1)
  }
}

module.exports = validateDependencies

@@ -24,41 +24,8 @@
  %7B%7D%0A
-let logger = %7B%7D%0Alet colors = %7B%7D%0A%0A
 try 
@@ -82,204 +82,194 @@
 s')%0A
-  logger = require('../logger')%0A  colors = require('colors/safe')%0A%7D catch (err) %7B%0A  console.log('Dependencies could not be checked due to %22' + err.message + '%22 error (NOT OK)')%0A  process.exit(1)%0A%7D
+%7D catch (err) %7B%0A  console.error('Please run %22npm install%22 before starting the application!')%0A  process.exit(1)%0A%7D%0Aconst logger = require('../logger')%0Aconst colors = require('colors/safe')
 %0A%0Aco

Move logger, colors out of try catch block