Installing Yarn in Machine Executor

Hey folks! After some prodding I’ve gotten my dependencies (Postgres) to run in docker-compose in a machine executor, but my tests run outside of that. I’d like to use yarn to run them (yarn test:e2e), but yarn isn’t installed by default on machine executors (I’m using Ubuntu btw). I tried installing yarn by following the instructions (running curl -o- -L | bash), which reports success, but then the next step immediately says “yarn: command not found”. Did I miss something?


1 Like

Hi @StevenLangbroek, welcome to Discuss!

I believe after installing yarn you will need to ensure it’s made available in the bash profile for the build, you can do so with something like this:

      - run: |
          curl -o- -L | bash
          echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV

Can you give the above a try and let me know if you continue to encounter issues running yarn? Thanks!


Works like a charm :slight_smile: thanks!


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.