I am running jenkins to build a react app and executing shell commands to build the app automatically. I following are the bash commands
cd /var/www/FarmGroWeb
sudo git reset --hard
sudo git pull origin dev
sudo yarn
sudo yarn build
It fails on the yarn step. The error output
sudo: yarn: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Tried adding #!/bin/sh as per this answer but this didn't work. What could be the workaround?
Yarn is not installed or not on the PATH for jenkins.
/usr/bin/yarn
).