Example Node.js code fails on the very first line

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’ });

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:

// 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:

$ source pc-test.js

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

Instead, try running it in Node.js:

$ node pc-test.js

Hope this helps!
-Silas