Added check for module existence due to an exception that is thrown when testing without 'node' module.