opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ] error:03080

Problem encountered when executing npm run build: error:0308010C:digital envelope routines::unsupported.
I asked GPT and said that the note version is too low, but it is obviously the latest version.
As shown in the figure,
insert image description here
I found many solutions:

Solution 1: Lower the version of note.

Option 2: Change the script method in package.json to this
insert image description here

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

Then execute this sentence directly in the terminal

$env:NODE_OPTIONS=“–openssl-legacy-provider”

Then npm run serve solves the problem, it works for me

Guess you like

Origin blog.csdn.net/qq_44727672/article/details/131881559