Jammming - localhost error

Hi,
I’m getting this error while trying to open a localhost server through VSC:

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\Documents\GitHub\Jammming\node_modules\webpack\lib\util\createHash.js:90:53)
at NormalModule._initBuildHash (C:\Users\Documents\GitHub\Jammming\node_modules\webpack\lib\NormalModule.js:386:16)
at handleParseError (C:\Users\Documents\GitHub\Jammming\node_modules\webpack\lib\NormalModule.js:434:10)
at C:\Users\Documents\GitHub\Jammming\node_modules\webpack\lib\NormalModule.js:466:5
at C:\Users\Documents\GitHub\Jammming\node_modules\webpack\lib\NormalModule.js:327:12
at C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
at C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:236:3
at runSyncOrAsync (C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
at iterateNormalLoaders (C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at Array. (C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (C:\Users\Documents\GitHub\Jammming\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
at C:\Users\Documents\GitHub\Jammming\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
C:\Users\Documents\GitHub\Jammming\node_modules\react-scripts\scripts\start.js:19
throw err;
^

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\Documents\GitHub\Jammming\node_modules\webpack\lib\util\createHash.js:90:53)
at NormalModule._initBuildHash (C:\Users\Documents\GitHub\Jammming\node_modules\webpack\lib\NormalModule.js:386:16)
at C:\Users\Documents\GitHub\Jammming\node_modules\webpack\lib\NormalModule.js:418:10
at C:\Users\Documents\GitHub\Jammming\node_modules\webpack\lib\NormalModule.js:293:13
at C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (C:\Users\Documents\GitHub\Jammming\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at C:\Users\Documents\GitHub\Jammming\node_modules\babel-loader\lib\index.js:51:103 {
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
}

Since the terminal issued tons of warnings for this project, I ran npm audit fix --force, but it didn’t solve the problem. Is it a problem with the starting files (it seems they’re deprecated and Codecademy should update them)? Or if it’s a problem on my side, how can I fix this?

Additionally, Jammming proved to be very difficult and frustrating to me. I had the impression I followed the instructions thoroughly, but after surge-sh deployment it turned out the whole page is totally broken. I don’t have any motivation to continue this project… Should I try, or move on to other projects? Any word of motivation for me? ;D

Thank you in advance,
xx Sue

Hi @zuza29 !

How are you?

First, Jammming is one of the hardest Codecademy’s project. If you look into the Discord channel, you’ll probably see people asking for help in this proyect. You will never be alone, you have Google, Discord, Forums, to find out the solution. Every single project can be hard and difficult, the key is the practice. Everyday you have to learn something, practice something and repeat something. If you think this is too much for you now, just continue and then come back when you feel confident. If you need specific help with another task, ask.

Second, the problem you have now. Always, its important and helpful read the terminal where we can see what is going on. In this case, you have something useful to start to investigate. At the beginning, you can see this:

Error: error:0308010C:digital envelope routines::unsupported

And, also at the end we have:

at C:\Users\Documents\GitHub\Jammming\node_modules\babel-loader\lib\index.js:51:103 {
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
}

So, with this information we saw that something went wrong. Here is where our best friend Google come into. In this world, as a programer, you will face it several times with code bugs or problems you have to solve. Don’t be afraid if something doesnt work at the first try.

Here you have to useful links that describe better the issue:

error:0308010C:digital envelope routines::unsupported

How to fix the err ossl evp unssuport

We have to investigate, read a lot to know new things. Even when we have a problem, we can learn something for future.

So, to summarize your problem. This issues occurs because Node.js v17 and later use OpenSSL v3.0 which has had breaking changes.

Assuming you are using a React Project, here is the solution:

Just go to your “package.json” file (it will be in your root folder). Find the “scripts”, and modify your start to look like this:

{
  "scripts": {
    "start": "react-scripts start --openssl-legacy-provider",
  }
}

Finally, you can initialize your project with “npm run start”.

Don’t give up. This is awesome! Have fun while do it.

Hi, thank you very much for such an exhaustive reply! Modifying the scripts worked, but only after I used the command export NODE_OPTIONS=–openssl-legacy-provider in Git Bash terminal (taken from bobbyhadz.com that you linked).

All the best,
xx Sue

1 Like

Awesome! Have a nice day! :smiley:

1 Like