# Snowflake - how to connect to Snowflake using NodeJS

Does anyone has a working code to connect NodeJS and Snowflake.

Tried following instructions for NodeJS:

var snowflake = require('snowflake-sdk');

var connection = snowflake.createConnection({
  account: 'account1',
  username: 'user1',
  password: 'pass1',
  region: 'us-east-1'
});

connection.connect(function(err, conn) {
  if (err) {
    console.error('Unable to connect: ' + err.message);
  } else {
    console.log('Successfully connected as id: ' + connection.getId());
  }
});
Keep getting errors:

Network error. Could not reach Snowflake.
Similarly - following instructions for Python works without problem (using EXACT same user/pass/account etc. as for NodeJS):

import snowflake.connector

ctx = snowflake.connector.connect(
    user='user1', 
    password='pass1',
    account='account1'
)

print ("SELECT current_version():")
cs = ctx.cursor()
try:
    cs.execute("SELECT current_version()")
    one = cs.fetchone()
    print(one[0])  # 2.50.2
finally:
    cs.close()

<a class="a a--md" elv="true" href="https://coursedrill.com/snowflake-training/">https://coursedrill.com/snowflake-training/</a>

##### Post Metadata
- Posted at: over 4 years ago
- Net upvotes: 1


## Comments
### Comment 1

you can follow this guide : https://docs.snowflake.com/en/user-guide/nodejs-driver-use.html

##### Comment Metadata
- Posted at: about 4 years ago
- Author title: (Serving Notice Period Immediate Joiner) Software Engineer L2 at Gemini Solutions | Python | ETL | Big Data



### Comment 2

Does this help? https://www.ameexusa.com/blogs/connecting-node-js-snowflake

##### Comment Metadata
- Posted at: about 4 years ago
- Author title: Transformational technology leader | Author and speaker | Team builder | Experienced public company executive




## Related Product
[Snowflake](https://www.g2.com/products/snowflake/reviews)

## Related Category
[Data Warehouse](https://www.g2.com/categories/data-warehouse)

## Related discussions
- [How well does Trello scale into a larger team?](https://www.g2.com/discussions/1-how-well-does-trello-scale-into-a-larger-team)
  - Posted at: almost 13 years ago
  - Comments: 6
- [Can we please add a new section](https://www.g2.com/discussions/2-can-we-please-add-a-new-section)
  - Posted at: almost 13 years ago
  - Comments: 0
- [Quantifiable benefits from implementing your CRM](https://www.g2.com/discussions/quantifiable-benefits-from-implementing-your-crm)
  - Posted at: almost 13 years ago
  - Comments: 4


