error:0308010C:digital envelope routines::unsupported

  • Post author:
  • Post category:其他




error:0308010C:digital envelope routines::unsupported



记录下问题

问题出现情况:

npm install 结束后 在npm run dev开始出现以下情况,百度后提示,node.js版本过高,于是呢,这边也没想着卸载什么,改添加百度给到的一些配置参数,结果对我这种情况并未起到作用

 INFO  Starting development server...
10% building 2/5 modules 3 active D:\java\workspace\LingxiPaasWeb\node_modules\webpack\hot\dev-server.jsError: error:0308010C:digital e
nvelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\NormalModule.js:358:12
    at D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\java\workspace\LingxiPaasWeb\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\java\workspace\LingxiPaasWeb\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
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 module.exports (D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\java\workspace\LingxiPaasWeb\node_modules\webpack\lib\NormalModule.js:358:12
    at D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at Array.<anonymous> (D:\java\workspace\LingxiPaasWeb\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\java\workspace\LingxiPaasWeb\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
    at D:\java\workspace\LingxiPaasWeb\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
    at D:\java\workspace\LingxiPaasWeb\node_modules\graceful-fs\graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.14.2



分析原因

这个貌似是版本过高的问题,直接卸载最新的,然后下载一个老版本,个人建议卸载干净,当然了也百度过别人提供的方案,例如修改配置文件增加命令什么的,对我好像都没起作用,但是又出现了其他问题——–这里先不说



解决方案

直接在控制面板中找到程序卸载–接着尝试敲 npm -v

预期是cmd中找不到命令的提示,预期正常

再接着 以为这就成功了 于是直接下载了nodejs的以前的版本

继续尝试 npm -v 的时候依旧报错

没办法,直接将报错的npm 下的目录全给删了也就是删的非常干净,再重新装一次,问题解决



版权声明:本文为weixin_44696435原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。