错误:错误:0308010C:数字信封例程::不支持-Next.js [英] Error: error:0308010C:digital envelope routines::unsupported - Next.js

查看:32
本文介绍了错误:错误:0308010C:数字信封例程::不支持-Next.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题出现在Node版本17的Next.js项目中我尝试了很多解决方案,但如果您遇到此问题,此解决方案是最好的解决方案


> landing-page@0.0.1 dev
> next dev

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
ready - started server on http://localhost:3000
node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (E:CollageCOURSES
eact.js projects21.Build and Deploy a Premium Next JS React Website _ Landing Page, Business Website, Portfolio
extjs_landing_page
ode_moduleswebpacklibutilcreateHash.js:135:53)
    at NormalModule._initBuildHash (E:CollageCOURSES
eact.js projects21.Build and Deploy a Premium Next JS React Website _ Landing 
Page, Business Website, Portfolio
extjs_landing_page
ode_moduleswebpacklibNormalModule.js:417:16)
    at handleParseError (E:CollageCOURSES
eact.js projects21.Build and Deploy a Premium Next JS React Website _ Landing Page, Business Website, Portfolio
extjs_landing_page
ode_moduleswebpacklibNormalModule.js:471:10)
    at E:CollageCOURSES
eact.js projects21.Build and Deploy a Premium Next JS React Website _ Landing Page, Business Website, Portfolio
extjs_landing_page
ode_moduleswebpacklibNormalModule.js:503:5
    at E:CollageCOURSES
eact.js projects21.Build and Deploy a Premium Next JS React Website _ Landing Page, Business Website, Portfolio
extjs_landing_page
ode_moduleswebpacklibNormalModule.js:358:12
    at E:CollageCOURSES
eact.js projects21.Build and Deploy a Premium Next JS React Website _ Landing Page, Business Website, Portfolio
extjs_landing_page
ode_modulesloader-runnerlibLoaderRunner.js:373:3
    at iterateNormalLoaders (E:CollageCOURSES
eact.js projects21.Build and Deploy a Premium Next JS React Website _ Landing Page, B    at Array.<anonymous> (E:CollageCOURSES
eact.js projects21.Build and Deploy a Premium Next JS React Website _ Landing Page, Business Website, Portfolio
extjs_landing_page
ode_modulesloader-runnerlibLoaderRunner.js:205:4) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v17.2.0

推荐答案

首先安装 cross-env

npx install cross-env

然后,只需在Package.json中的脚本中设置它

"dev": "cross-env NODE_OPTIONS='--openssl-legacy-provider' next dev",

上次运行此命令

npm run dev

这篇关于错误:错误:0308010C:数字信封例程::不支持-Next.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆