0

We had upgrade to node 17.4.0. After that Storybook started giving error on start:

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

From what I found it's because we use 17.x node. But unfortunately we can't downgrade, so I wanted to have two versions of node and be able to switch between them depending on what I do. I installed 16.x node: nvm install v16.14.2 If I check currently used node version it will be 16.x, but when I run npm run storybook I see that it starts with version 17.x and fails. How can I setup my Storybook to be launching with version 16.x?

Alyona
  • 1,362
  • 2
  • 17
  • 32

1 Answers1

0

In your package.json: change this line. and have a look on this as well (https://itsmycode.com/error-digital-envelope-routines-unsupported/)

Check this out Getting error 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'

"start": "react-scripts start"

to

"scripts": {
    "start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
    "build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
}

or

"scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build",
}
Milan Sachani
  • 95
  • 2
  • 6
  • didn't work for me – Alyona Apr 06 '22 at 12:21
  • it definitely should work can you show what error are you having in your terminal? – Milan Sachani Apr 06 '22 at 12:24
  • ` opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }` – Alyona Apr 06 '22 at 12:24
  • I have edited the answer for you and have a look I have found one link maybe it could help. because in my it is working when I change to the "start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start" – Milan Sachani Apr 06 '22 at 12:32