Using nvm in build shell script causes 'No such file or directory' error
I'm using Jenkins to build a Cordova project.
Recently I've upgraded the Jenkins server (a MacMini running Mojave) from a standard node install to use NVM.
I'd like to call nvm from within the build script I call from Jenkins' Build > Execute Shell option.
However when I reference nvm from within the script (see below examples) I get the error 'No such file or directory'.
I can run the script directly from the server's terminal with no error, NVM is sourced within ~/.profile, .profile is sourced within ~/.bashrc and .bashrc is sourced within ~/.bash_profile.
I am aware of the NVMWrapper plugin, but am avoiding that for the time being due to not being certain it will work with my current version of Jenkins and I'd rather not break Jenkins as our resident Jenkins expert is currently unavailable.