Error: error:0308010C:digital envelope routines::unsupported
版本
错误
Lucky@Lucky MINGW64 /e/_DockerDesktop/strong/strong-data (master)
$ npm run serve
> @smallwei/strong-data@2.0.1 serve
> vue-cli-service serve
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
INFO Starting development server...
<s> [webpack.Progress] 0% compiling
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:138:10)
at module.exports (E:\_DockerDesktop\strong\strong-data\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (E:\_DockerDesktop\strong\strong-data\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (E:\_DockerDesktop\strong\strong-data\node_modules\webpack\lib\NormalModule.js:471:10)
at E:\_DockerDesktop\strong\strong-data\node_modules\webpack\lib\NormalModule.js:503:5
at E:\_DockerDesktop\strong\strong-data\node_modules\webpack\lib\NormalModule.js:358:12
at E:\_DockerDesktop\strong\strong-data\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (E:\_DockerDesktop\strong\strong-data\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at Array.<anonymous> (E:\_DockerDesktop\strong\strong-data\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (E:\_DockerDesktop\strong\strong-data\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
at E:\_DockerDesktop\strong\strong-data\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
at E:\_DockerDesktop\strong\strong-data\node_modules\graceful-fs\graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v20.5.0
解决
export NODE_OPTIONS=--openssl-legacy-provider
打包
export NODE_OPTIONS=--openssl-legacy-provider
npm run build
winpty docker build -t datav-nginx:1.0.21 .
winpty docker run --name datav-nginx -p 8081:80 -d datav-nginx:1.0.21
参考
Error message "error:0308010C:digital envelope routines::unsupported"