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,
I found many solutions:
Solution 1: Lower the version of note.
Option 2: Change the script method in package.json to this
"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