【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"

相关推荐
王哲晓几秒前
第三十章 章节练习商品列表组件封装
前端·javascript·vue.js
fg_4113 分钟前
无网络安装ionic和运行
前端·npm
理想不理想v5 分钟前
‌Vue 3相比Vue 2的主要改进‌?
前端·javascript·vue.js·面试
酷酷的阿云15 分钟前
不用ECharts!从0到1徒手撸一个Vue3柱状图
前端·javascript·vue.js
微信:1379712058717 分钟前
web端手机录音
前端
齐 飞23 分钟前
MongoDB笔记01-概念与安装
前端·数据库·笔记·后端·mongodb
神仙别闹40 分钟前
基于tensorflow和flask的本地图片库web图片搜索引擎
前端·flask·tensorflow
GIS程序媛—椰子2 小时前
【Vue 全家桶】7、Vue UI组件库(更新中)
前端·vue.js
DogEgg_0012 小时前
前端八股文(一)HTML 持续更新中。。。
前端·html
ZL不懂前端2 小时前
Content Security Policy (CSP)
前端·javascript·面试