{"id":151,"hash":"71603720ecb3d5c07fe8b5efa4076f38e3698da29e3b1d777f81478fbd6291d5","pattern":"Getting error &#39;digital envelope routines&#39;, reason: &#39;unsupported&#39;, code: &#39;ERR_OSSL_EVP_UNSUPPORTED&#39;","full_message":"I got this error when learning Next.js, using npx create-next-app command according to site documentation here https://nextjs.org/docs/api-reference/create-next-app. Everything works until I start the server,\n\nError stack:\n\n$ npm run dev\n\n> devto-clone@0.1.0 dev\n> next dev\n\nready - started server on 0.0.0.0:3000, url: http://localhost:3000\ninfo  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5\nError: error:0308010C:digital envelope routines::unsupported\n    at new Hash (node:internal/crypto/hash:67:19)\n    at Object.createHash (node:crypto:130:10)\n    at BulkUpdateDecorator.hashFactory (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:138971:18)\n    at BulkUpdateDecorator.update (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:138872:50)\n    at OriginalSource.updateHash (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack-sources3\\index.js:1:10264)\n    at NormalModule._initBuildHash (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68468:17)\n    at handleParseResult (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68534:10)\n    at C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68628:4\n    at processResult (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68343:11)\n    at C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68407:5\nError: error:0308010C:digital envelope routines::unsupported\n    at new Hash (node:internal/crypto/hash:67:19)\n    at Object.createHash (node:crypto:130:10)\n    at BulkUpdateDecorator.hashFactory (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:138971:18)\n    at BulkUpdateDecorator.update (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:138872:50)\n    at OriginalSource.updateHash (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack-sources3\\index.js:1:10264)\n    at NormalModule._initBuildHash (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68468:17)\n    at handleParseResult (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68534:10)\n    at C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68628:4\n    at processResult (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68343:11)\n    at C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68407:5\nnode:internal/crypto/hash:67\n  this[kHandle] = new _Hash(algorithm, xofLen);\n                  ^\n\nError: error:0308010C:digital envelope routines::unsupported\n    at new Hash (node:internal/crypto/hash:67:19)\n    at Object.createHash (node:crypto:130:10)\n    at BulkUpdateDecorator.hashFactory (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:138971:18)\n    at BulkUpdateDecorator.update (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:138872:50)\n    at OriginalSource.updateHash (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack-sources3\\index.js:1:10264)\n    at NormalModule._initBuildHash (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68468:17)\n    at handleParseResult (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68534:10)\n    at C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68628:4\n    at processResult (C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68343:11)\n    at C:\\xampp\\htdocs\\devto-clone\\node_modules\\next\\dist\\compiled\\webpack\\bundle5.js:68407:5 {\n  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],\n  library: 'digital envelope routines',\n  reason: 'unsupported',\n  code: 'ERR_OSSL_EVP_UNSUPPORTED'\n}\n\nNode.js v17.0.1\n\npackage.json :\n\n{\n  \"name\": \"devto-clone\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next build\",\n    \"start\": \"next start\",\n    \"lint\": \"next lint\"\n  },\n  \"dependencies\": {\n    \"next\": \"11.1.2\",\n    \"react\": \"17.0.2\",\n    \"react-dom\": \"17.0.2\"\n  },\n  \"devDependencies\": {\n    \"eslint\": \"7.32.0\",\n    \"eslint-config-next\": \"11.1.2\"\n  }\n}","ecosystem":"npm","package_name":"node.js","package_version":null,"solution":"I found this solution https://github.com/webpack/webpack/issues/14532\n\nif using bash just run NODE_OPTIONS=--openssl-legacy-provider before any command\n\nadding NODE_OPTIONS=--openssl-legacy-provider to package.json\n\n\"scripts\": {\n   \"start\": \"SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start\",\n   \"build\": \"SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build\"\n },\n\nEdit\n\nIn my case, I'm using Nodejs 17.0.1 version and causing this error.\n\nFirstly I'm using this command export NODE_OPTIONS=--openssl-legacy-provider before any command in GitBash Windows to fix this issue.\n\nBut, I think it's not an efficient way, so what I do is :\n\nUninstall Nodejs 17.0.1\nInstall it again Nodejs 16.13.0 version\nI'm facing error another error when I start the server using \"yarn serve\" (another of my exiting Vuejs project), I don't remember what is this, but after I run \"yarn\" and \"yarn serve\", everything works now as I accept","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/69719601/getting-error-digital-envelope-routines-reason-unsupported-code-err-oss","votes":95,"created_at":"2026-04-19T04:41:25.070734+00:00","updated_at":"2026-04-19T04:51:06.841072+00:00"}