'Why snowflake-sdk causing multiple errors in angularJs?

I have an angular project, cli version:

Angular CLI: 13.3.5
Node: 14.17.0
Package Manager: npm 6.14.13
OS: win32 ia32

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1303.5 (cli-only)
@angular-devkit/core         13.3.5 (cli-only)
@angular-devkit/schematics   13.3.5 (cli-only)
@schematics/angular          13.3.5 (cli-only)

I'm trying to create snowflake connection from typescript page, following this steps:

I ran in cmd npm i snowflake-sdk then in first.component.ts- I wrote the following code:

snowflake = require('snowflake-sdk');
connection = this.snowflake.createConnection({
account: 'xxx',
username: 'yyy',
password: '***',
region: 'us-east-1'});

but then I get this error:

Compiled with problems:X

ERROR in ./node_modules/@colors/colors/lib/system/supports-colors.js 28:9-22

Module not found: Error: Can't resolve 'os' in 
'C:\Users\riki7\Desktop\hackathon_2022\node_modules\@colors\colors\lib\system'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }


ERROR in ./node_modules/@techteamer/ocsp/lib/ocsp/agent.js 3:13-28

and lot more. when I comment the connection = I still get this error.

any idea?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source