1

I am trying to run a simple Couchbase node.js client. On AWS Linux box I run

sudo yum install gcc-c++ 

Then run

 npm install couchbase

but there are compilation errors such as

npm ERR!  lcb_sockdata_t *lcbio_C_ai2sock(lcbio_pTABLE io, struct addrinfo **ai, int *conerr);
npm ERR!                                                          ^~~~~~~~
npm ERR! In file included from /home/ec2-user/.cache/node-gyp/17.2.0/include/node/openssl/././archs/linux-x86_64/asm/include/openssl/ssl.h:21:0,
npm ERR!                  from /home/ec2-user/.cache/node-gyp/17.2.0/include/node/openssl/./ssl_asm.h:11,
npm ERR!                  from /home/ec2-user/.cache/node-gyp/17.2.0/include/node/openssl/ssl.h:4,
npm ERR!                  from ../deps/lcb/src/ssl/ssl_iot_common.h:26,
npm ERR!                  from ../deps/lcb/src/ssl/ssl_c.c:18:
npm ERR! /home/ec2-user/.cache/node-gyp/17.2.0/include/node/openssl/macros.h:155:4: error: #error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
npm ERR!  #  error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
npm ERR!     ^~~~~

Any ideas on how to resolve this?

Bill007
  • 19
  • 2
  • 1
    Can you try installing it on Node.js version 16.x (LTS)? It looks like you are using 17.2, which is the latest release, however Couchbase targets LTS support rather than the latest build. – ejscribner Dec 16 '21 at 01:15

1 Answers1

3

It seems you are running Node 17.2.0. The official SDK states it only supports LTS versions:

https://docs.couchbase.com/nodejs-sdk/current/hello-world/start-using-sdk.html#installing-the-sdk

I recommend trying the latest LTS version of Node (16.13.1) and seeing if that resolves the issue or not.

Costoda
  • 66
  • 1
  • 4