Pinecone node js error: TypeError - PineconeClient is not a constructor

264 Views Asked by At

I followed the docs: https://github.com/pinecone-io/pinecone-ts-client

I installed it via:

npm install @pinecone-database/pinecone

I've also set the following environmental variables:

PINECONE_API_KEY="your_api_key"
PINECONE_ENVIRONMENT="your_environment"

And then I have:

const PineconeClient = require('@pinecone-database/pinecone')
const pinecone = new PineconeClient();

But I'm getting the error:

TypeError - PineconeClient is not a constructor

Why is that the case? I'm following the docs but I'm getting the error?

The version of pinecone I have:

"@pinecone-database/pinecone": "^1.1.2"

And my node version is:

v20.9.0
0

There are 0 best solutions below