JavaScript Client

Hi we have ELK on a server running 7.17.1

I am trying to use the JavaScript Client. I am following the instructions but I am getting this error

Where buffer.constants is undefined in file 'webpack:///node_modules/@elastic/elasticsearch/lib/Transport.js'

const MAX_BUFFER_LENGTH = buffer.constants.MAX_LENGTH

This is what my app that used the JS ES Client is set to.

Angular CLI: 13.3.5
Node: 16.15.0
Package Manager: npm 8.5.5
OS: linux x64

Angular: <error>
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.5 (cli-only)
@angular-devkit/build-angular   <error>
@angular-devkit/core            13.3.5 (cli-only)
@angular-devkit/schematics      13.3.5 (cli-only)
@angular/cli                    13.3.5 (cli-only)
@schematics/angular             13.3.5 (cli-only)
rxjs                            6.6.7 (cli-only)
typescript                      <error>
webpack                         <error>


package.json
  "devDependencies": {
    "@elastic/elasticsearch": "7.17",

  "dependencies": {
    "@types/elasticsearch": "^5.0.40",

Any idea what the issue could be be? Thank you,
Kristine