me-me
me-me

Reputation: 5819

how to get automator app to run a yarn command

I'm setting up an automator run shell script to go to a specific folder on users machines and then yarn run dev but when it gets to the yarn part it can't find yarn.

-line 1: yarn: command not found

If I use terminal then yarn will run fine. I have yarn installed -g which is in my NVM modules.

Here is my script in automator.

cd ~/Documents/myProject
yarn run dev 

Also tired this setup: enter image description here

Upvotes: 0

Views: 1226

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207758

Like this:

export PATH=$PATH:/Users/me/.nvm/versions/node/v10.16.3/bin
cd ~/Documents/myProject
yarn run dev

The first line tells bash where to look for programs, such as yarn and node.

Upvotes: 1

Related Questions