Terminal and shell

Fix "command not found" right after installing something

Your terminal hasn't picked up the new program yet. Reload it, or check the program's folder is on your PATH.

Fill these in once
  1. Reload your shell settings
    Terminal
    source ~/.zshrc && hash -r

    Or simply close the terminal and open a new one.

  2. See where your shell looks for programs
    Terminal
    echo $PATH | tr ':' '\n'
  3. Check whether the program exists anywhere
    Terminal
    which -a node

    Nothing printed? Its folder isn't on your PATH. See Add a folder to your PATH.

  1. Reload your shell settings
    Terminal · Ubuntu / Debian
    source ~/.bashrc && hash -r

    Or simply close the terminal and open a new one.

  2. See where your shell looks for programs
    Terminal · Ubuntu / Debian
    echo $PATH | tr ':' '\n'
  3. Check whether the program exists anywhere
    Terminal · Ubuntu / Debian
    which -a node

    Nothing printed? Its folder isn't on your PATH. See Add a folder to your PATH.

  1. Reload PATH in this window
    PowerShell
    $env:Path = [Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [Environment]::GetEnvironmentVariable("Path", "User")

    Or close PowerShell and open a new one.

  2. See where Windows looks for programs
    PowerShell
    $env:Path -split ';'
  3. Check whether the program exists anywhere
    PowerShell
    Get-Command node -All

    An error means its folder isn't on your PATH. See Add a folder to your PATH.