NVM is not working on Jenkins execute shell
You need to remember that Jenkins is running commands in non-interactive shell so PATH is different from what a normal user has. One way to solve this problem is to invoke nvm with it absolute path.
Adding those solves the issue:
. ~/.nvm/nvm.sh
. ~/.profile
. ~/.bashrc
After struggling to get the suggestions above to work, I tried the NodeJS Jenkins plugin and it worked like a charm.
https://plugins.jenkins.io/nodejs/