OpenSSL security changes in Node.js 17

Solution 1: Use Legacy OpenSSL Provider (Quick Fix)

Try running your project with the OpenSSL legacy provider enabled:

shCopyEditset NODE_OPTIONS=--openssl-legacy-provider && npm start

For macOS/Linux:

shCopyEditexport NODE_OPTIONS=--openssl-legacy-provider && npm start

This will bypass the error but is not a long-term solution.


Solution 2: Downgrade Node.js

If the project dependencies are not yet compatible with the latest Node.js versions, downgrade to Node.js 16 (LTS). Use nvm (Node Version Manager) to manage different versions:

shCopyEditnvm install 16
nvm use 16

Then, reinstall dependencies:

shCopyEditrm -rf node_modules package-lock.json
npm install
npm start

Solution 3: Upgrade Webpack

If you are using an older version of Webpack, upgrading might resolve the issue.

  1. Check Webpack version:shCopyEditnpm list webpack
  2. Upgrade Webpack:shCopyEditnpm install webpack@latest --save-dev
  3. Restart the project:shCopyEditnpm start

Solution 4: Modify Webpack Config (If Applicable)

If you have a custom Webpack configuration, modify it to use md4 hashing instead of md5:

jsCopyEditconst webpack = require('webpack');

module.exports = {
  // Other Webpack settings
  resolve: {
    fallback: {
      crypto: require.resolve("crypto-browserify"),
    },
  },
  plugins: [
    new webpack.ProvidePlugin({
      process: "process/browser",
    }),
  ],
};