报错信息:
$ vue-cli-service serve
INFO Starting development server...
[92%] sealing (asset processing ThemeColorReplacer)
Extracted theme color css content length: 26565
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at getHash (E:\Code\vueProjects\my-project\node_modules\webpack-theme-color-replacer\src\replaceFileName.js:17:21)
at replaceFileName (E:\Code\vueProjects\my-project\node_modules\webpack-theme-color-replacer\src\replaceFileName.js:10:
68)
at getFileName (E:\Code\vueProjects\my-project\node_modules\webpack-theme-color-replacer\src\Handler.js:57:40)
at Handler.handle (E:\Code\vueProjects\my-project\node_modules\webpack-theme-color-replacer\src\Handler.js:41:26)
at E:\Code\vueProjects\my-project\node_modules\webpack-theme-color-replacer\src\index.js:37:38
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}Node.js v18.16.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
解决
install完后运行命令行
$env:NODE_OPTIONS="--openssl-legacy-provider"
再重新运行项目即可。