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
The current version of SAM is SAM 2021.12. 02 Revision 2, SSC 274. Use the Download buttons below to download the current version for Windows, Mac, or Linux.
The sam build command processes your AWS SAM template file, application code, and any applicable language-specific files and dependencies. The command also copies build artifacts in the format and location expected for subsequent steps in your workflow.
Shell error: "command not found" If you receive this error, your shell can't locate the AWS SAM CLI executable in the path. Verify the location of the directory where you installed the AWS SAM CLI executable, and then verify that the directory is on your path.
You can use alias sam="sam.cmd" if it works in normal cmd. Now sam --version should work. 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 %*
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.
Here is how I got it work with an alias.
alias sam="/c/Program\ Files/Amazon/AWSSAMCLI/bin/sam.cmd"
$ vi ~/.bashrc # or favorite editor
Add:
alias sam='sam.cmd'
Then:
$ source ./.bashrc # can use '. ./.bashrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With