# Example Node.js code fails on the very first line

**URL:** <https://community.pinecone.io/t/example-node-js-code-fails-on-the-very-first-line/7203>\
**Category:** Support\
**Tags:** vector-database\
**Created:** [December 19, 2024, 11:38pm UTC](https://community.pinecone.io/t/example-node-js-code-fails-on-the-very-first-line/7203 "2024-12-19T23:38:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom.meehan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/tom.meehan/32/3670_2.png) [@tom.meehan](https://community.pinecone.io/u/tom.meehan)\
**Post date:** [December 19, 2024, 11:38pm UTC](https://community.pinecone.io/t/example-node-js-code-fails-on-the-very-first-line/7203/1 "2024-12-19T23:38:20Z")

</div>

When I execute the following, I get zsh: parse error near `}'. By the way I have used my actual api key. However it doesn’t even get that far… if I only send the import line, I get the error. Any help with this would be apprectiated. Thanks

// Import the Pinecone library  
import { Pinecone } from ‘@pinecone-database/pinecone’;

// Initialize a Pinecone client with your API key  
const pc = new Pinecone({ apiKey: ‘YOUR\_API\_KEY’ });

---

<div class="post-metadata">

**Author:** ![silas](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/silas/32/1337_2.png) [@silas](https://community.pinecone.io/u/silas)\
**Post date:** [December 20, 2024, 12:20am UTC](https://community.pinecone.io/t/example-node-js-code-fails-on-the-very-first-line/7203/2 "2024-12-20T00:20:15Z")

</div>

Hi there, looks like you may be trying to evaluate your JS file in ZSH instead of running it in node.

For example, I can reproduce the error you’re getting if I have a file `pc-test.js`:

```js
// Import the Pinecone library
import { Pinecone } from ‘@pinecone-database/pinecone’;

// Initialize a Pinecone client with your API key
const pc = new Pinecone({ apiKey: ‘YOUR_API_KEY’ });

```

and at the shell I enter:

```sh
$ source pc-test.js

pc-test.js:1: parse error near `}'

```

Instead, try running it in Node.js:

```sh
$ node pc-test.js

```

Hope this helps!  
-Silas
