Skip to content

Reliably set environment variables on Windows and Mac #5057

@soypat

Description

@soypat

Windows

During quick install of windows tinygo using the tinygo release (not scoop) the instructions suggest setting PATH environment variable with set https://tinygo.org/getting-started/install/windows/

This does not set the PATH permanently, so tinygo will only work during that shell session. Best way to go about setting PATH permanently on windows is via the "Environment Variables"system config dialog box.

Mac

Same for mac, export just sets the environment in current shell.

To set PATH on every shell one can edit their shell profile. This depends on what shell they use.

echo $SHELL

For zsh users, this is .zshrc. For bash users this is .bashrc. Find the file in your home folder and add export PATH=$PATH:/path/to/your/tinygo to the end:

nano $HOME/.zshrc
# or for bash users:
nano $HOME/.bashrc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions