I have a java application built with Gradle on CircleCI.
I need to be able to build and test a nodejs client module before it is packaged as a jar bundled with the main java app.
The client module is located within a sub-directory i.e.
cd ./myapp-client && npm install
cd ./myapp-client && node_modules/.bin/ng test
cd ./myapp-client && node_modules/.bin/ng build -prod
All of those commands you've mentioned you can run from
A build on CircleCI happens within a container. Both Java, NodeJS, and other languages are already pre-installed for your use.
Depending on your needs, you can also build the client module as a separate project.