# Install Pub Global

When you use the `pub global` command, it's necessary to have Dart's `pub` tool installed and the PATH environment variable updated to include the location of the `pub` command. This allows you to execute the `pub` command from anywhere in your system, which is especially important for running globally activated packages.

## Setting up PATH on Windows

1. Use the search function to find 'Edit the system environment variables'.
2. In the System Properties dialog, click on 'Environment Variables'.
3. Under 'System Variables', find and select 'Path', then click 'Edit'.
4. Click 'New' and add the path to the `.pub-cache/bin` directory, for example, `C:\Users<username>\AppData\Local\Pub\Cache\bin`.
5. Click 'OK' to apply the changes.\\

## Setting up PATH on macOS/Linux

1. Open a terminal.
2. Edit the profile file for your shell, such as `.bash_profile`, `.bashrc`, `.zshrc`, etc.
3. Add the following line to the file: `export PATH="$PATH":"$HOME/.pub-cache/bin"`.
4. To apply the changes, either restart your terminal session or source the profile file, e.g., `source ~/.zshrc`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.junestory.com/etc/install-pub-global.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
