Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:135:10)
    at module.exports (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
10% building 2/5 modules 3 active /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/hot/dev-server.jsnode: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:135:10)
    at module.exports (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/zhangxingxing/Projects/switch_data_center_vue/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /Users/zhangxingxing/Projects/switch_data_center_vue/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 v17.9.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

两种解决方式:

1.尝试卸载Node.js 17+版本并重新安装Node.js 16+版本

您可以从他们的官方网站重新安装当前的 LTS 节点 js 版本。或更具体的从这里下载;

您可以使用 NVM(节点版本管理器)

Linux 和 Mac 用户可以使用这个 nvm 包 - https://github.com/nvm-sh/nvm
Windows 用户可以使用这个 nvm 包 - https://github.com/coreybutler/nvm-windows

2.打开终端并按照说明粘贴这些:

Linux & Mac OS (windows git bash)-

export NODE_OPTIONS=--openssl-legacy-provider

Windows 命令提示符 -

set NODE_OPTIONS=--openssl-legacy-provider

参考链接

0条评论 顺序楼层
请先登录再回复