downgrading to Node.js 16):

nvm install 16 --lts
nvm use 16

I decided to install node@16.0.0 as a development dependency in the project.

npm install node@16.0.0 --save-dev

Then include in the scripts the command "dev": "npm run serve".

"scripts": {
    "dev": "npm run serve",
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
},

This will make it so that when you run the command "npm run dev"

npm run dev

it will run the script using the node of your project's dependencies.

Concerning this error, after doing some much research, i finally discovered that the whole error comes with the nodejs upgrade to version v18.12.1, so i advice everyone facing this same issue who just recently upgraded tio node v18.12.1 to downgrade back to node v16.0.0, if u need help with this , you can use nvm.

some steps are outlined below, with some link to resources

  1. Download and install nvm Follow instructions here
  1. Install Nodejs v16.0.0 nvm install 16.0.0

  2. Uninstall nodejs v18.12.1 nvm uninstall 18.12.1 or your own version of node

Worked for me. On windows you just uninstall node.js 18 as per usual, then download/install 16. 


I changed node version node:16.3.0-alpine and it worked however can any body explain digital envelope routines please

Try

node -v
v17.4.0

then roll back to node --lts (node v16.13.2 (npm v8.1.2)) for that use nvm.

nvm install 16

then check node -v and confirm it's version 16.

Error with node version v18.0.0 and nuxt framework version 2.15 when running dev server and will be fixed by:

"scripts": {
  "dev": "NODE_OPTIONS=--openssl-legacy-provider nuxt"
}

Running audit fixed the problem for me

npm audit fix --force

Pass --openssl-legacy-provider to Webpack or the CLI Tool

In a React app, for instance, you can pass --openssl-legacy-provider to the start script like this "react-scripts --openssl-legacy-provider start".


That should do it. But if this fails to fix the error, then proceed to the next fix. On many occasions, it works.

Use an LTS Version of Node JS

Consider downgrading your Node version to 16.16.0 or other LTS versions.


Currently, 18.12.1 is the latest LTS version of Node. You can download it from the Node JS official website or use NVM to install it.

export NODE_OPTIONS=--openssl-legacy-provider

For Windows CMD (Command Prompt):


set NODE_OPTIONS=--openssl-legacy-provider

For Windows PowerShell:


$env:NODE_OPTIONS="--openssl-legacy-provider"

For Docker, include the following in your Dockerfile:


ENV NODE_OPTIONS="--openssl-legacy-provider"


 include the --openssl-legacy-provider flag in your package.json file in the scripts field. For example:


{

  "scripts": {

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

  }

}