0

I was assigned a task to work on the front end of a react application but I have faced a very strange error. When I forked and cloned it on my machine, I ran npm i for installing the necessary dependencies. After the installation was complete I ran the command npm start in order to run the project on my machine and I was returned with an exception. The error message is attached with the question as well, Error Screenshot-1, ScreenShot-2. It said digital envelope routines are unsupported.

I searched for the question on Stackoverflow and also followed various instructions but nothing happened. Can someone tell me the solution to the problem and why it might be happening?

Currently, I am using node version 18.16.0.

Talha Munir
  • 121
  • 5

3 Answers3

1

I was facing errors in same project on windows.

I deleted the project and then Re-cloned it.

I installed nvm (Node Version Manager) and followed these steps:

install the latest version of Node JS using the following command

nvm install latest

it will install the latest version of Node JS

the execute the following command to use the latest version.

nvm use latest

then run npm i in both frontend and backend folder in the project

then install Node version 14.16.0 it is required for the project, using the command

nvm install 14.16.0

and

nvm use 14.16.0

then run

npm install

in the Cloud-express (root directory)

and the execute the following command

npm start

these steps worked for me and the project is now running well.

0

Try to run that on your terminal before running start or install command:

# linux
export NODE_OPTIONS=--openssl-legacy-provider
# windows
set NODE_OPTIONS=--openssl-legacy-provider

Related question:

0

The error message “0308010C:digital envelope routines::unsupported” occurs when the MD4 algorithm used by Webpack is no longer supported by default in the latest Node.js version. To fix this error, you can upgrade Webpack to version 5 which implements its own MD4 algorithm without depending on Node’s implementation. Another solution is to set the NODE_OPTIONS environment variable to --openssl-legacy-provider when running your development server. The two solutions are explained in detail in the link below.

abhishek2046
  • 312
  • 1
  • 11