0

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?

Riwaj Chalise
  • 195
  • 1
  • 2
  • 6

1 Answers1

0

Yarn is not installed or not on the PATH for jenkins.

  • Install Yarn
  • Check it's on Jenkins' $PATH, or provide the full path in the script (e.g. /usr/bin/yarn).
shearn89
  • 3,143
  • 2
  • 14
  • 39