Unable to run Okta angular sample project

Hi,

Source project: samples-js-angular/okta-hosted-login at master · okta/samples-js-angular · GitHub

Believe I have all the dependencies in place (node/JS so who really ever knows? :slight_smile: ), getting the following (2nd error trace stack below) when I attempt the following angular server start cmd …

~/environment/samples-js-angular/okta-hosted-login (master) $ ng serve
Node.js version v17.0.1 detected.
Odd numbered Node.js versions will not enter LTS status and should not be used for production. For more information, please see Releases | Node.js.
Your global Angular CLI version (13.0.0-rc.1) is greater than your local version (11.2.14). The local Angular CLI version is used.

To disable this warning use “ng config -g cli.warnings.versionMismatch false”.
Compiling @angular/core : es2015 as esm2015
Compiling @angular/common : es2015 as esm2015
Compiling @angular/platform-browser : es2015 as esm2015
Compiling @angular/platform-browser-dynamic : es2015 as esm2015
Compiling @angular/common/http : es2015 as esm2015
Compiling @angular/router : es2015 as esm2015
Compiling @okta/okta-angular : es2015 as esm2015
⠸ Generating browser application bundles (phase: building)…node:internal/crypto/hash:67
this[kHandle] = new _Hash(algorithm, xofLen);
^

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (/home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/webpack/lib/NormalModule.js:471:10)
at /home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/webpack/lib/NormalModule.js:503:5
at /home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/webpack/lib/NormalModule.js:358:12
at /home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/loader-runner/lib/LoaderRunner.js:236:3
at context.callback (/home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.loader (/home/ec2-user/environment/samples-js-angular/okta-hosted-login/node_modules/css-loader/dist/index.js:183:3) {
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
}

Node.js v17.0.1


Suggestion on remediation steps?

Thank you,

This seems to be a Node.js v17 problem. I think this message explains it well. Maybe try v16?

Node.js version v17.0.1 detected.
Odd numbered Node.js versions will not enter LTS status and should not be used for production. For more information, please see https://nodejs.org/en/about/releases/.

I just tried v16 with our Okta CLI and Angular (okta start angular) and it seems to work fine.

If I try it with v17, it blows up:

Compiling @okta/okta-angular : es2015 as esm2015
⠙ Generating browser application bundles (phase: building)...node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (/Users/mraible/Downloads/angular/node_modules/webpack/lib/util/createHash.js:145:18)
    at BulkUpdateDecorator.update (/Users/mraible/Downloads/angular/node_modules/webpack/lib/util/createHash.js:46:50)
    at RawSource.updateHash (/Users/mraible/Downloads/angular/node_modules/webpack/node_modules/webpack-sources/lib/RawSource.js:77:8)
    at NormalModule._initBuildHash (/Users/mraible/Downloads/angular/node_modules/webpack/lib/NormalModule.js:880:17)
    at handleParseResult (/Users/mraible/Downloads/angular/node_modules/webpack/lib/NormalModule.js:946:10)
    at /Users/mraible/Downloads/angular/node_modules/webpack/lib/NormalModule.js:1040:4
    at processResult (/Users/mraible/Downloads/angular/node_modules/webpack/lib/NormalModule.js:755:11)
    at /Users/mraible/Downloads/angular/node_modules/webpack/lib/NormalModule.js:819:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'