[Resolved] Cannot contact elasticsearch database

I cannot seem to contact the elasticsearch database, below is a snippet on my code

  var elasticsearch = require(['elasticsearch'], function() {
  var client = new elasticsearch.Client({
    host: 'localhost:9200',
    log: 'trace'
    });
  });

  var results = client.search(
  {
    "query": {
      "bool": {
        "must": [
        {
          "match_all": {}
        },
        ]
      }
    }
  })

The problem comes where I am unable to create a client, and it does not seem to recognise any elasticsearch when I try to import it using require.

Any help would be much appreciated.

What is your project name? What error messages are you seeing?

Hello. I just solved the problem, I just forgot to input elasticsearch as one of my dependancies.