INFO Starting development server... 95% emitting CompressionPlugin ERROR Error: error:0308010C:digital envelope routines::unsupported Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:79:19) at Object.createHash (node:crypto:139:10) at CompressionPlugin.getTask (F:\work\projects\yhwz\web\node_modules\compression-webpack-plugin\dist\index.js:228:38) at getTask.next (<anonymous>) at F:\work\projects\yhwz\web\node_modules\compression-webpack-plugin\dist\index.js:274:59 at CompressionPlugin.runTasks (F:\work\projects\yhwz\web\node_modules\compression-webpack-plugin\dist\index.js:298:9) at compressionFn (F:\work\projects\yhwz\web\node_modules\compression-webpack-plugin\dist\index.js:321:18) at F:\work\projects\yhwz\web\node_modules\compression-webpack-plugin\dist\index.js:333:7 at _next1 (eval at create (F:\work\projects\yhwz\web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:26:17) at eval (eval at create (F:\work\projects\yhwz\web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:45:1) at F:\work\projects\yhwz\web\node_modules\copy-webpack-plugin\dist\index.js:91:9
当运行 npm run serve 报错以上错误,处理解决方案如下:
$env:NODE_OPTIONS="--openssl-legacy-provider"
可以看到我用的版本还是算高的:
PS F:\work\projects\web> nvm list 23.3.0 * 20.15.0 (Currently using 64-bit executable) 20.12.0 18.20.5 17.9.1
错误截图: