Score:0

Jenkins Shell script not working. Yarn: command not found

cn flag

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?

Score:0
cn flag

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).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.