# Simple node.js test fails

**URL:** <https://community.pinecone.io/t/simple-node-js-test-fails/5281>\
**Category:** Support\
**Created:** [April 21, 2024, 5:29am UTC](https://community.pinecone.io/t/simple-node-js-test-fails/5281 "2024-04-21T05:29:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![billreynolds007](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/billreynolds007/32/2466_2.png) [@billreynolds007](https://community.pinecone.io/u/billreynolds007)\
**Post date:** [April 21, 2024, 5:29am UTC](https://community.pinecone.io/t/simple-node-js-test-fails/5281/1 "2024-04-21T05:29:26Z")

</div>

I was regression testing an application that previously was able to perform simple connection and queries. Today the connection is not even succeeding. To diagnose I then created a new Windows folder and installed the node.js module. Here is my simple test which also fails to list the indices. Nothing is displayed. It just exists.  
The node version is v21.6.0.  
Thank you for any insight.

> var {Pinecone} = require( “@pinecone-database/pinecone” );  
> const pinecone = new Pinecone({  
> apiKey: PINECONE\_API\_KEY,  
> });
> 
> async function test()  
> {  
> var indexes = await pinecone.listIndexes();  
> console.log(‘indexes’, indexes);  
> }
> 
> test();

---

<div class="post-metadata">

**Author:** ![billreynolds007](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/billreynolds007/32/2466_2.png) [@billreynolds007](https://community.pinecone.io/u/billreynolds007)\
**Post date:** [April 21, 2024, 7:52pm UTC](https://community.pinecone.io/t/simple-node-js-test-fails/5281/2 "2024-04-21T19:52:52Z")

</div>

The problem encountered is similar to

> [@I am not able connect the pinecone database in the Node.Js](https://community.pinecone.io/t/i-am-not-able-connect-the-pinecone-database-in-the-node-js/5265):
>
> Hey guys, I am using node.js for accessing the pinecone database but I am getting this error suddenly. Can anyone tell me reason and solution of this problem? Here is the code: const { Pinecone } = require('@pinecone-database/pinecone'); const pinecone = new Pinecone({ apiKey: 'MY\_API\_KEY', // environment: 'us-east-1', // projectId: '5j25ef7', });

There is no stack dump or any other feedback.  
This is Windows 10 and gcp-starter.

---

<div class="post-metadata">

**Author:** ![zeke](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/zeke/32/4257_2.png) [@zeke](https://community.pinecone.io/u/zeke)\
**Post date:** [April 24, 2024, 8:45pm UTC](https://community.pinecone.io/t/simple-node-js-test-fails/5281/3 "2024-04-24T20:45:24Z")

</div>

Hi @billreynolds007, please share the version of the `pinecone-ts-client` you are using. Note that the most recent version is `v2.2.0`.

Additionally, please attempt to list the indexes using a cURL request and let us know the result.

```auto
PINECONE_API_KEY="YOUR_API_KEY"

curl -i -X GET "https://api.pinecone.io/indexes" \
  -H "Api-Key: $PINECONE_API_KEY"

```

---

<div class="post-metadata">

**Author:** ![billreynolds007](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/billreynolds007/32/2466_2.png) [@billreynolds007](https://community.pinecone.io/u/billreynolds007)\
**Post date:** [April 26, 2024, 1:45am UTC](https://community.pinecone.io/t/simple-node-js-test-fails/5281/4 "2024-04-26T01:45:34Z")

</div>

The curl (or wget) test worked of course 😉

After several hours the culprit (at least on Windows) is node v21.6.0.  
Using version v20.12.2 and all is well.

It may be related to  
["[DEP0040] The `punycode` module is deprecated" with Node.js 21.x · Issue #9005 · yarnpkg/yarn · GitHub](https://github.com/yarnpkg/yarn/issues/9005)

You all may want to try the newer node version at your end.
