【node】Error message “error:0308010C:digital envelope routines::unsupported“

Error: error:0308010C:digital envelope routines::unsupported

版本

【nvm】node版本升降版本

错误

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"

相关推荐
web1478621072326 分钟前
C# .Net Web 路由相关配置
前端·c#·.net
m0_7482478027 分钟前
Flutter Intl包使用指南:实现国际化和本地化
前端·javascript·flutter
飞的肖30 分钟前
前端使用 Element Plus架构vue3.0实现图片拖拉拽,后等比压缩,上传到Spring Boot后端
前端·spring boot·架构
青灯文案138 分钟前
前端 HTTP 请求由 Nginx 反向代理和 API 网关到后端服务的流程
前端·nginx·http
m0_7482548843 分钟前
DataX3.0+DataX-Web部署分布式可视化ETL系统
前端·分布式·etl
ZJ_.1 小时前
WPSJS:让 WPS 办公与 JavaScript 完美联动
开发语言·前端·javascript·vscode·ecmascript·wps
GIS开发特训营1 小时前
Vue零基础教程|从前端框架到GIS开发系列课程(七)响应式系统介绍
前端·vue.js·前端框架·gis开发·webgis·三维gis
Cachel wood1 小时前
python round四舍五入和decimal库精确四舍五入
java·linux·前端·数据库·vue.js·python·前端框架
学代码的小前端1 小时前
0基础学前端-----CSS DAY9
前端·css
joan_851 小时前
layui表格templet图片渲染--模板字符串和字符串拼接
前端·javascript·layui