I've just provisioned a new cluster in AWS and come across the following:
TypeError: Invalid apiVersion "5.1", expected a function or one of _default, 5.0, 2.4, 2.3, 2.2, 2.1, 2.0, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0, 0.90, 5.x, master
I'm going to go with 5.0 for now as this is just testing currently.
Please give the beta version a try, it supports both 5.1 and 5.2 branches of elasticsearch
npm install elasticsearch@beta
@spalger the same problem that was reported in this issue seems to have re-appeared after the last release. With version 15.4.0 it seems that everything works fine.
The latest versions of elasticsearch-js have a supported list of ...
TypeError: Invalid apiVersion "5.1", expected a function or one of _default, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 2.4, 1.7, 0.90, 6.7, 7.0, 7.x, master
But we still have a system on an AWS cluster running 5.1.1.
I believe our resolution is to pin to an older version of elasticsearch-js until we upgrade the cluster.
At the time of this issue 5.1 was new and unsupported. Now 5.1 is pretty old and the module is just bloated keeping around all of the 5.x APIs, so I trimmed it down to only include the latest from the 5.x branch. For the majority of applications using 5.6 with a 5.1 cluster won't cause any problems, though it might mean a couple extra methods or parameters that Elasticsearch doesn't actually support show up. As you can see in https://www.diffchecker.com/8wh77zOR the two API versions are pretty close to identical.
@spalger Does that resolve the apiVersion error or would we still need to pin to a specific version?
Most helpful comment
The latest versions of
elasticsearch-jshave a supported list of ...But we still have a system on an AWS cluster running
5.1.1.I believe our resolution is to pin to an older version of
elasticsearch-jsuntil we upgrade the cluster.