Search code examples
git-bashaws-sam-cli

Git bash will not resolve "sam" command


I am using Win10 latest. After installing AWS-SAM-CLI and testing the installation with:

sam --version

I get the message

bash: sam: command not found

however, when I use Powershell, cmd or ConEmu they can all resolve "sam".

the path is "e/Program Files/Amazon/AWSSAMCLI/bin" but other commands like "yarn" work fine which is also installed at "e/Program Files/..."

Any ideas? Thanks


Solution

  • sam.cmd --version
    

    The windows version of the SAM CLI does not have a direct executable binary. It is instead a .cmd script that echos your options to the python executable.

    @rem
    @echo off
    
    setlocal
    
    "%~dp0/../runtime/python.exe" -m samcli %*
    

    I haven't figured out how to make it work with

    sam --version
    

    My assumption is that powershell and command prompt see .cmd as an executable not requiring an extension where git bash does not.