NodeJS 我在react project中遇到了一个问题,npm启动问题?

rt4zxlrg  于 2023-06-22  发布在  Node.js
关注(0)|答案(1)|浏览(138)

你好,我在React项目中遇到了问题。我安装了node js和python,然后在设置中为两者设置env变量,Openssl也安装了,但是当我运行npm start时,我得到了这个错误。。有人经历过这个吗。启动开发服务器...

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\CodeBox\master\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\CodeBox\master\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (D:\CodeBox\master\node_modules\webpack\lib\NormalModule.js:471:10)
    at D:\CodeBox\master\node_modules\webpack\lib\NormalModule.js:503:5
    at D:\CodeBox\master\node_modules\webpack\lib\NormalModule.js:358:12
    at D:\CodeBox\master\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (D:\CodeBox\master\node_modules\loader-runner\lib\LoaderRunner.js:214:10) 
    at iterateNormalLoaders (D:\CodeBox\master\node_modules\loader-runner\lib\LoaderRunner.js:221:10) 
D:\CodeBox\master\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (D:\CodeBox\master\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (D:\CodeBox\master\node_modules\webpack\lib\NormalModule.js:417:16)
    at D:\CodeBox\master\node_modules\webpack\lib\NormalModule.js:452:10
    at D:\CodeBox\master\node_modules\webpack\lib\NormalModule.js:323:13
    at D:\CodeBox\master\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\CodeBox\master\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\CodeBox\master\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at D:\CodeBox\master\node_modules\babel-loader\lib\index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.0
我安装了OpenSSL并设置了varilbels...无法运行该项目?
任何安装都需要

brccelvz

brccelvz1#

尝试将您的Node版本降级到v16。我建议使用nnvm,因为手动切换Node版本可能会很麻烦。

相关问题