Can't find command "Yarn" and "NPM"

When running the “Yarn” command on the Mac via automation with Jenkins and even with DroneCI, it can’t find the command for this. Same goes for “NPM” too.

Both NodeJS, NPM, and Yarn are installed on this machine and works finally when running the commands manually from an SSH connection and on the Mac direclty.

Now, I did say this issue also occurs on DroneCI, so this isn’t isolated to the CI/CD tool but there must be something I can fix in macOS?

If yarn is not present and accessible in your PATH for Jenkins, it can’t pick it up.

You’ll need to declare it as an environment variable (withEnv()).

Yeah, well, I tried that.

I ended up getting it to work with a Exec runner with DroneCI. If it works, it works so I’ll be sticking with that I guess. I usually use a SSH runner.