곽동현
곽동현

Reputation: 227

how to fix 'ERR_OSSL_EVP_UNSUPPORTED' ERROR in vue?

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.4.0

When npm run service is performed, this error occurs. Currently, node is v16.14.0 version, and the same error is repeated even though it was continuously reinstalled because these errors occur frequently in node v17.

"scripts": {
    "serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
    "build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
    "lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
},

If you use the above code, it can be executed, but a problem occurs again when building an image with a docker. Is there a solution?

Upvotes: 20

Views: 30414

Answers (5)

Nio D. Garcia
Nio D. Garcia

Reputation: 11

I also had the same initial error:

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

I solved this situtation in my used version {Node.js v21.6.1} for both run serve and build. I used the next lines in script area for package.json file:

 "scripts": {
    "serve": "set NODE_OPTIONS=--openssl-legacy-provider &&  vue-cli-service serve",
    "build": "set NODE_OPTIONS=--openssl-legacy-provider &&  vue-cli-service build"
 }

I hope you could solve this.

Upvotes: 1

Yaohui Wu
Yaohui Wu

Reputation: 95

Just add a NODE_OPTIONS environment variable to your .bashrc/.zhrc and reopen the shell console:

export NODE_OPTIONS="--openssl-legacy-provider"

It solved my problem and had no cross env issue.

Upvotes: 1

SashoSTZ
SashoSTZ

Reputation: 302

I tried all the above, none of them worked.

Turned out I had to update the project:

npm update

This fixed it and now works as expected

(Answering for all it the same situation as me)

Upvotes: 7

sameraze agvvl
sameraze agvvl

Reputation: 485

add like below in your package.json omit the export , it will working for me

"scripts": {
     "serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
},

Upvotes: 12

Ryan Farmer
Ryan Farmer

Reputation: 401

In Windows I was able to resolve this error using the following:

"scripts": {
    "serve": "set NODE_OPTIONS=--openssl-legacy-provider &&  vue-cli-service serve",
    ...
}

Upvotes: 40

Related Questions