s

angular exception digital envelope routines unsupported edit button Edit

author
Murugan Andezuthu Dharmaratnam | calendar 03 December 2023 | 167

if you're encountering the "digital envelope routines::unsupported" error while trying to run an Angular application with Webpack on Node.js version 18. This error is a common issue related to the compatibility of Node.js with the cryptographic library used by Webpack.

Solution

Modify package.json, You can also add this variable directly in the scripts section of your package.json file . This will ensure that the variable is set whenever you run npm start. "start": "set NODE_OPTIONS=--openssl-legacy-provider && ng serve --proxy-config proxy.config.json",

Set the Node.js Environment Variable This command tells Node.js to use the legacy provider for OpenSSL, which should resolve the incompatibility. set NODE_OPTIONS=--openssl-legacy-provider