2
respostas

[Bug] Problema em iniciar o projeto

baixei o projeto zipado, deszipei ele e rodei o npm install, deu tudo certo até aqui, rodei o npm run all e tbm tudo funcionado, porem quando tento abrir no navegador na seguinte url(http://localhost:4200/) ele me retorna a seguinte mensagem de erro no terminal:

npm run all

> ng-test1@0.0.0 all
> concurrently "npm run api" "npm run start"

[1]
[1] > ng-test1@0.0.0 start
[1] > ng serve
[1]
[0]
[0] > ng-test1@0.0.0 api
[0] > node ./server/server.js
[0]
[0] Servidor escutando na porta: 3000
[1] - Generating browser application bundles...
[1] (node:28040) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
[1] (Use `node --trace-deprecation ...` to show where the warning was created)
[1] node:internal/crypto/hash:69
[1]   this[kHandle] = new _Hash(algorithm, xofLen);
[1]                   ^
[1]
[1] Error: error:0308010C:digital envelope routines::unsupported
[1]     at new Hash (node:internal/crypto/hash:69:19)
[1]     at Object.createHash (node:crypto:133:10)
[1]     at module.exports (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\webpack\lib\util\createHash.js:135:53)
[1]     at NormalModule._initBuildHash (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\webpack\lib\NormalModule.js:417:16)
[1]     at C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\webpack\lib\NormalModule.js:452:10
[1]     at C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\webpack\lib\NormalModule.js:323:13
[1]     at C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\loader-runner\lib\LoaderRunner.js:367:11
[1]     at C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\loader-runner\lib\LoaderRunner.js:203:19
[1]     at VirtualFileSystemDecorator.readFile (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\@ngtools\webpack\src\virtual_file_system_decorator.js:48:13)
[1]     at processResource (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\loader-runner\lib\LoaderRunner.js:202:11)
[1]     at iteratePitchingLoaders (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\loader-runner\lib\LoaderRunner.js:158:10)
[1]     at runLoaders (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\loader-runner\lib\LoaderRunner.js:365:2)
[1]     at NormalModule.doBuild (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\webpack\lib\NormalModule.js:295:3)
[1]     at NormalModule.build (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\webpack\lib\NormalModule.js:446:15)
[1]     at Compilation.buildModule (C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\webpack\lib\Compilation.js:739:10)
[1]     at C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\webpack\lib\Compilation.js:981:14 {
[1]   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
[1]   library: 'digital envelope routines',
[1]   reason: 'unsupported',
[1]   code: 'ERR_OSSL_EVP_UNSUPPORTED'
[1] }
[1]
[1] Node.js v18.18.0
[1] npm run start exited with code 1
2 respostas

Bom dia, isso tem haver com a versão do node que foi feito o projeto e a versão que você está usando. Da uma olhada neste vídeo, pode te ajudar -> https://www.youtube.com/watch?v=m1hqGazAHLU

Boa tarde Marcos,

obrigado pela sua resposta, mas esse video nao funcionou mto bem n...

tentei procurar uma solução tbm a partir do erro e uma das solucoes foi setar uma variavel de ambiente:

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

parou de dar o erro.. mas agora ele está reclamando do css...

Error: ./src/styles.scss
[1] Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
[1] ModuleBuildError: Module build failed (from ./node_modules/css-loader/dist/cjs.js):
[1] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in C:\Users\ivan-\Downloads\Compressed\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\ng-test2-52a4d12c3cc45a4b9403691fd6437b2f985baec4\node_modules\css-loader\node_modules\postcss\package.json

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software