开发喵星球

若依前端npm run dev启动时报错

亲测有效🎉🎉🎉
本文主要解决问题:若依前端npm run dev启动时报错:

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 (/Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/user/Programming Documents/WebServer/untitled/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/user/Programming Documents/WebServer/untitled/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/user/Programming Documents/WebServer/untitled/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/user/Programming Documents/WebServer/untitled/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
/Users/user/Programming Documents/WebServer/untitled/node_modules/react-scripts/scripts/start.js:19
  throw err;

解决办法:

1、第1种解决方案(亲测有效)
这种方案需要将当前的node js版本降低到v12.x~v14.x

2、第2种解决方案(亲测有效)
这种方案可以在不降低node js版本的前提下,解决这个问题。针对不同的系统进行选择。

set NODE_OPTIONS=--openssl-legacy-provider
$env:NODE_OPTIONS = "--openssl-legacy-provider"
export NODE_OPTIONS=--openssl-legacy-provider

启动成功🌟

   
分类:Java/OOP, Node.js, 前端工程师 作者:无限繁荣, 吴蓉 发表于:2023-09-12 14:55:10 阅读量:141
<<   >>


powered by kaifamiao