# Path problems: How to give buildkite-agent user access to yarn and python (Amazon Linux)

**URL:** <https://forum.buildkite.community/t/path-problems-how-to-give-buildkite-agent-user-access-to-yarn-and-python-amazon-linux/2523>\
**Category:** Pipelines\
**Created:** [January 26, 2023, 7:48pm UTC](https://forum.buildkite.community/t/path-problems-how-to-give-buildkite-agent-user-access-to-yarn-and-python-amazon-linux/2523 "2023-01-26T19:48:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sotrh](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@sotrh](https://forum.buildkite.community/u/sotrh)\
**Post date:** [January 26, 2023, 7:48pm UTC](https://forum.buildkite.community/t/path-problems-how-to-give-buildkite-agent-user-access-to-yarn-and-python-amazon-linux/2523/1 "2023-01-26T19:48:40Z")

</div>

We have made a VM on Amazon EC2 that will be used to test builds. I’ve installed yarn, python, as well as rustup, and while those all work for the default user, but the `buildkite-agent` user doesn’t have access to these (likely as they are installed locally). I’m trying to install the various dependencies for the `buildkite-agent`, but I can’t figure out where to update the `$PATH` variable so that it can use yarn and the like.

Any help would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![karen.sawrey](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/karen.sawrey/32/1188_2.png) [@karen.sawrey](https://forum.buildkite.community/u/karen.sawrey)\
**Post date:** [January 27, 2023, 5:52pm UTC](https://forum.buildkite.community/t/path-problems-how-to-give-buildkite-agent-user-access-to-yarn-and-python-amazon-linux/2523/2 "2023-01-27T17:52:01Z")

</div>

Hello, @sotrh! Welcome to the community!

It would greatly help if you could provide more information. How did you install the agent? Can you please outline the steps you’ve taken because the issue might not be just about the path?

To update the `$PATH` variable for your Buildkite agent, you can add the desired paths to the `buildkite-agent` script.

To do it, you need to locate the `buildkite-agent` script on your system (typically located in `/usr/local/bin/buildkite-agent`). Open the script and find the line where the `$PATH` variable is set (it should look like `PATH="$BUILDKITE_AGENT_PATH:$PATH"`). Add the desired paths to the `$PATH` variable, save and close the script.

You’ll need to restart the Buildkite agent for the changes to take effect.

Alternatively, you can also set the `$PATH` variable on the command line before starting the agent (running it as `buildkite-agent` user). For example:

```auto
export PATH=$PATH:/usr/local/bin
buildkite-agent start

```

Looking forward to receiving the additional information from you.  
Cheers!

---

<div class="post-metadata">

**Author:** ![sotrh](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@sotrh](https://forum.buildkite.community/u/sotrh)\
**Post date:** [January 27, 2023, 6:51pm UTC](https://forum.buildkite.community/t/path-problems-how-to-give-buildkite-agent-user-access-to-yarn-and-python-amazon-linux/2523/3 "2023-01-27T18:51:37Z")

</div>

I installed the Buildkite agent via the docs [Installing Buildkite Agent on Ubuntu v3 | Buildkite Documentation](https://buildkite.com/docs/agent/v3/ubuntu#main). I checked to the `buildkite-agent` script you mentioned, but the `/usr/local/bin` directory is empty.

Also as far as running as the buildkite-agent user, I don’t know the password associated with the account. I can access it with `sudo su buildkite-agent`, but installing `nvm` and `yarn` that way doesn’t add it to the path.

_EDIT:_ To give more context I have a `.profile` file at `/var/lib/buildkite-agent`. Loading directly in the shell allows me to run build commands, but the automated system doesn’t seem to be using the file.

---

<div class="post-metadata">

**Author:** ![karen.sawrey](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/karen.sawrey/32/1188_2.png) [@karen.sawrey](https://forum.buildkite.community/u/karen.sawrey)\
**Post date:** [January 30, 2023, 5:11pm UTC](https://forum.buildkite.community/t/path-problems-how-to-give-buildkite-agent-user-access-to-yarn-and-python-amazon-linux/2523/4 "2023-01-30T17:11:10Z")

</div>

Hello, @sotrh! Thank you for supplying the additional information!  
There are several possible ways to get your `buildkite-agent` user to be able to use yarn and nvm:

- You can make your first step in the pipeline the step that does the installation of all the packages that will be necessary.
- You can install all the dependencies globally - so all users on your machine will have access to them.
- Or you can isolate all the dependencies by using [Docker](https://buildkite.com/docs/agent/v3/docker).

Cheers!
