When I try to run unit tests on my CDK Java project with mvn test, I get an error that Node v8.9.1 has reached end-of-life and is not supported..
But Node v12.22.1 is my current version, which I check right before running Maven.
node --version
v12.22.1
mvn test
....
Curiously, if I run Maven through the IntelliJ GUI, it works.
I have set my node version with nvm, if that matters. And I'm on a Mac.
Is there some environment variable I need to set? How does the CDK determine which node to use?
Any ideas?
Thanks!
Full output:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! !!
!! Node v8.9.1 has reached end-of-life and is not supported. !!
!! You may to encounter runtime issues, and should switch to a supported release. !!
!! !!
!! As of the current release, supported versions of node are: !!
!! - ^12.7.0 !!
!! - ^14.5.0 !!
!! - ^16.3.0 !!
!! !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
(node:14462) Warning: process.on(SIGPROF) is reserved while debugging
/private/var/folders/nr/dkx1p38s24nb7fx_qgcxggcm0000gn/T/jsii-java-runtime8055040669944096944/lib/program.js:467
} catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3