Redux project won't start

Hello, I just have started redux course and on the very beginning there is an issue after using “npm i” in console, in “Setting Up the Development Environment” section. First when I try to install npm I get an “npm WARN deprecated” error on 7 modules, and also I get information that there is
“13 vulnerabilities (1 low, 3 moderate, 7 high, 2 critical)”. I tried using npm audit fix, and npm audit fix --force as listed below in the console, but it didn’t help. When I ignore the fact that some modules are deprecated and then try to start project locally using npm start i get this error that stops project from running in the browser:

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:138:10)
at module.exports (C:\Users\Domino\Desktop\Kody\mosh-redux\Source Code\redux-starter\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\Domino\Desktop\Kody\mosh-redux\Source Code\redux-starter\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\Domino\Desktop\Kody\mosh-redux\Source Code\redux-starter\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\Domino\Desktop\Kody\mosh-redux\Source Code\redux-starter\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\Domino\Desktop\Kody\mosh-redux\Source Code\redux-starter\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\Domino\Desktop\Kody\mosh-redux\Source Code\redux-starter\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\Domino\Desktop\Kody\mosh-redux\Source Code\redux-starter\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at Array. (C:\Users\Domino\Desktop\Kody\mosh-redux\Source Code\redux-starter\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’
}

1 Like

Probably you have solved it or left it for good. I will post my solution here for others who encounter the same issue.
After you run npm i, install the latest webpack:
npm install webpack@latest webpack-cli@latest webpack-dev-server@latest,
and then, modify the “webpack.config.js”:

devServer: {
  contentBase: path.join(__dirname, "dist"),
  port: 9000
}

change to

devServer: {
  static: {
    directory: path.join(__dirname, "dist")
  },
  port: 9000
}

And it’s done. Now you visit http://localhost:9000/ to preview the webpage.

6 Likes

Thank you! This worked - you’re amazing!

My problem is solved. Thanks a lot

Thanks , it solved the problem