canove/whaticket-community

Erro no build do frontend

altamiro opened this issue · 3 comments

Estou tentando rodar o frontend e volta este erro abaixo, já mudei a versão do Node.js e mesmo assim apresenta o erro. Alguém sabe como resolver isso?

npm run build

frontend@0.1.0 build
react-scripts build

Creating an optimized production build...
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/home/deploy/whaticket/frontend/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/home/deploy/whaticket/frontend/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/home/deploy/whaticket/frontend/node_modules/webpack/lib/NormalModule.js:471:10)
at /home/deploy/whaticket/frontend/node_modules/webpack/lib/NormalModule.js:503:5
at /home/deploy/whaticket/frontend/node_modules/webpack/lib/NormalModule.js:358:12
at /home/deploy/whaticket/frontend/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/home/deploy/whaticket/frontend/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/home/deploy/whaticket/frontend/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
/home/deploy/whaticket/frontend/node_modules/react-scripts/scripts/build.js:19
throw err;
^

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/home/deploy/whaticket/frontend/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/home/deploy/whaticket/frontend/node_modules/webpack/lib/NormalModule.js:417:16)
at /home/deploy/whaticket/frontend/node_modules/webpack/lib/NormalModule.js:452:10
at /home/deploy/whaticket/frontend/node_modules/webpack/lib/NormalModule.js:323:13
at /home/deploy/whaticket/frontend/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /home/deploy/whaticket/frontend/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/home/deploy/whaticket/frontend/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at /home/deploy/whaticket/frontend/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.19.1

export NODE_OPTIONS="--max_old_space_size=1024 --openssl-legacy-provider"

https://stackoverflow.com/questions/74726224/opensslerrorstack-error03000086digital-envelope-routinesinitialization-e

Aqui estão duas opções agora -

Tente desinstalar o Node.js versão 17+ e reinstalar o Node.js versão 16+
Você pode reinstalar a versão atual do LTS Node.js em seu site oficial . Ou downloads mais específicos aqui ;

Você pode usar NVM (Node Version Manager)

Usuários de Linux e Mac podem usar este link do pacote nvm
Os usuários do Windows podem usar este link do pacote nvm
Abra um terminal e cole-os conforme descrito:
Linux e macOS (Windows Git Bash) –

export NODE_OPTIONS=--openssl-legacy-provider
Prompt de comando do Windows-

set NODE_OPTIONS=--openssl-legacy-provider
Windows PowerShell-

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