由于某些奇怪的原因,我正在运行的 React18 应用程序现在已经损坏,并且我没有在节点模块或脚本等方面进行任何更改。现在,当我使用 npm run dev 运行应用程序时,出现以下错误
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:130:10)
at module.exports (/Users/ddd/thank-you-cards-new/node_modules/webpack/lib/util/createHash.js:90:53)
at Normal
我的 package.json 在脚本部分有以下行...我使用 npm run dev 来运行我的应用程序
"scripts": {
"dev": "export REACT_APP_ENV=DEVELOPMENT PORT=7011 && react-scripts start",
}
我的核心节点模块如下...
"react": "^18.2.0",
"react-app-rewired": "^2.2.1",
"react-colorful": "^5.6.1",
"react-dom": "^18.2.0",
"react-idle-timer": "^5.4.2",
"react-router-dom": "^6.4.2",
"react-scripts": "^2.1.3",
您可能使用了错误的节点版本,您需要将节点版本更改为 16。重新安装节点 16 或使用 nvm