Olá. Estou fazendo um porjeto angular e estou enfrentando os erros abaixo na hora de rodar o script de testes:
error 13-Nov-2023 08:10:12 if (error?.stack) {
error 13-Nov-2023 08:10:12 ^
error 13-Nov-2023 08:10:12
error 13-Nov-2023 08:10:12 SyntaxError: Unexpected token .
error 13-Nov-2023 08:10:12 at new Script (vm.js:79:7)
error 13-Nov-2023 08:10:12 at createScript (vm.js:251:10)
error 13-Nov-2023 08:10:12 at Object.runInThisContext (vm.js:303:10)
error 13-Nov-2023 08:10:12 at Module._compile (internal/modules/cjs/loader.js:657:28)
error 13-Nov-2023 08:10:12 at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
error 13-Nov-2023 08:10:12 at Module.load (internal/modules/cjs/loader.js:599:32)
error 13-Nov-2023 08:10:12 at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
error 13-Nov-2023 08:10:12 at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error 13-Nov-2023 08:10:12 at Module.require (internal/modules/cjs/loader.js:637:17)
error 13-Nov-2023 08:10:12 at require (internal/modules/cjs/helpers.js:22:18)
error 13-Nov-2023 08:10:12 npm ERR! code ELIFECYCLE
error 13-Nov-2023 08:10:12 npm ERR! errno 1
error 13-Nov-2023 08:10:12 npm ERR! my-app test: `jest --watchAll --detectOpenHandles`
error 13-Nov-2023 08:10:12 npm ERR! Exit status 1
error 13-Nov-2023 08:10:12 npm ERR!
error 13-Nov-2023 08:10:12 npm ERR! Failed at the my-app test script.
error 13-Nov-2023 08:10:12 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
error 13-Nov-2023 08:10:12
error 13-Nov-2023 08:10:12 npm ERR! A complete log of this run can be found in:
error 13-Nov-2023 08:10:12 npm ERR! /home/bamboo/.npm/_logs/2023-11-13T11_10_12_741Z-debug.log
Pelo que pesquisei tem a ver com a versão do Node estar abaixo do que a necessária para o Jest. Gostaria de saber como posso mudá-la e como corrigir o erro de unexpected token.