Error: error:0308010C:digital envelope routines::unsupported
B站尚硅谷尚医通项目P101
在nuxt使用npm run dev时出现:
node:internal/crypto/hash:71 this[kHandle] = new _Hash(algorithm, xofLen); ^Error: error:0308010C:digital envelope routines::unsupported at Object.createHash (node:crypto:133:10) at NormalModule._initBuildHash (D:scodeworkspaceyyghyygh_siteode_moduleswebpacklibNormalModule.js:417:16) at handleParseError (D:scodeworkspaceyyghyygh_siteode_moduleswebpacklibNormalModule.js:471:10) at D:scodeworkspaceyyghyygh_siteode_moduleswebpacklibNormalModule.js:503:5 at D:scodeworkspaceyyghyygh_siteode_moduleswebpacklibNormalModule.js:358:12 at D:scodeworkspaceyyghyygh_siteode_moduleswebpackode_modulesloader-runnerlibLoaderRunner.js:373:3 at iterateNormalLoaders (D:scodeworkspaceyyghyygh_siteode_moduleswebpackode_modulesloader-runnerlibLoaderRunner.js:214:10) at Array. (D:scodeworkspaceyyghyygh_siteode_moduleswebpackode_modulesloader-runnerlibLoaderRunner.js:205:4) { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'}
在发现使用set NODE_OPTIONS=–openssl-legacy-provider不好使的情况下
解决方法: 给 node.js 降版本,最好不使用17及以上版本
这里使用 node16.19.0
链接:Index of /download/release/v16.19.0/ (nodejs.org)https://nodejs.org/download/release/v16.19.0/
已成功运行: