Creé el proyecto IntelliJ IDEA React predeterminado y obtuve esto:
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; ^Parece ser un problema reciente: webpack se encontró con esto hace 4 días y todavía está trabajando en ello .
Aquí hay dos opciones ahora:
1. Intente desinstalar Node.js versión 17+ y reinstale Node.js versión 16+
2. Abra la terminal y péguelos como se describe:
Linux y Mac OS (windows git bash)-
export NODE_OPTIONS=--openssl-legacy-providerSímbolo del sistema de Windows-
set NODE_OPTIONS=--openssl-legacy-providerEnlace de referencia.
En su paquete.json: cambie esta línea
"start": "react-scripts start"para
"start": "react-scripts --openssl-legacy-provider start"Si usamos la versión LTS actual de Node.js, este error no aparecerá. Rebaje su versión de Node.js a la versión LTS actual (16.13.0).
Puede haber varias formas de instalar la versión requerida. Uno de ellos está usando nvm (administrador de versiones de Node.js).
Paso 1: Instale nvm (si no está instalado, siga Instalar Node.js localmente con Node Version Manager (nvm) )
Paso 2: nvm install 16.13.0 (o lts)