error:0308010C:digital envelope routines::unsupported
Node.js v18.14.1 运行项目
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 BulkUpdateDecorator.hashFactory (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:184154:18) at BulkUpdateDecorator.update (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:184055:50) at OriginalSource.updateHash (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack-sources2\index.js:1:51038) at NormalModule._initBuildHash (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:115961:17) at handleParseResult (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:116027:10) at F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:116119:4 at processResult (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:115836:11) at F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:115900:5 at F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:35132:3 at iterateNormalLoaders (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:34958:10) at Array.<anonymous> (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:34949:4) at runCallbacks (F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:24341:15) at F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:24514:4 at F:\workspace\vanblog\packages\admin\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:33829:16 { 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
"build": "set NODE_OPTIONS=--openssl-legacy-provider && umi build", "deploy": "npm run build && npm run gh-pages", "dev": "set NODE_OPTIONS=--openssl-legacy-provider && npm run start:dev",