I am currently setting up a Jenkins script, and have encountered a problem building with NX. My build command is the following
sh "npx nx affected --base=HEAD~1 --target=build --parallel=3 --verbose"
Whenever this runs locally it works fine, but once running in Jenkins it doesn't work. The build istelf works fine, but directly after it, NX appareantly tries to run "fs.rm" which isn't recognized. What can i do to skip this step, or how can i fix it?
After a bit of troubleshooting i found the issue. Our Jenkins server was using the wrong agent. After forcing it to use a node-16 agent, this problem no longer persists.