1

Any idea how to fix the attached errors after npm install and npm start lightning chart typescript example from github,

running on Windows 11, the Manu Help shows Node.js: 16.14.2, but the vsc terminal node --version shows 18.12.0

Visual Studio Code > Help

Version: 1.73.0 (user setup)
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22000
Sandboxed: No

Opened a New Terminal in VSC:

 npm install

/////////////////////npm install


PS C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master> npm install
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated source-map-resolve@0.5.2: See https://github.com/lydell/source-map-resolve#deprecated

added 655 packages, and audited 656 packages in 8s

19 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (1 moderate, 12 high, 1 critical)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.


///////////////////////npm start

PS C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master> npm start  

> lcjs-typescript-example@1.0.0 start
> webpack-dev-server

(node:23548) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
i 「wds」: Project is running at http://localhost:8080/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\dist
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\NormalModule.js:417:16)      
    at handleParseError (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\loader-runner\lib\LoaderRunner.js:214:10)       
    at iterateNormalLoaders (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\loader-runner\lib\LoaderRunner.js:221:10)       
node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\NormalModule.js:417:16)      
    at handleParseError (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\loader-runner\lib\LoaderRunner.js:214:10)       
    at Array.<anonymous> (C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master\node_modules\loader-runner\lib\LoaderRunner.js:205:4) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.0
PS C:\Users\XYZ\Downloads\lcjs-typescript-example-master\lcjs-typescript-example-master> node --version
v18.12.0
Fred J.
  • 5,759
  • 10
  • 57
  • 106

1 Answers1

2

This issue seems to come from WebPack using MD5 hashes by default which OpenSSL has deprecated. I have pushed a change to the lcjs-typescript-example repository that hopefully fixes this issue for you.

If it doesn't help then take a look at this other discussion on StackOverflow https://stackoverflow.com/a/69746937/6198227

You should be able to use --openssl-legacy-provider node option to use older version of OpenSSL that supports the deprecated hashing methods.

Snekw
  • 2,590
  • 1
  • 15
  • 24