错误提示:
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.__webpack_modules__.57442.module.exports (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:135907:62)
at NormalModule._initBuildHash (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:109317:16)
at handleParseError (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:109371:10)
at /Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:109403:5 at /Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:109258:12 at /Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:61157:3 at iterateNormalLoaders (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:60998:10)
at Array. (/Users/workspace/React/umiapp/node_modules/@umijs/deps/compiled/webpack/4/bundle4.js:60989:4) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'}
Node.js v18.7.0
解决办法:
export NODE_OPTIONS=--openssl-legacy-provider
node.js不同版本下载地址:
https://nodejs.org/dist/