Windows WSL: SAM CLI was not found
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 807
- Avg merge
- 10h 12m
- Merged PRs (30d)
- 7
Description
## AWS toolkit is unable to find SAM, although it worked correctly at first once I reopened vscode it is unable to find SAM CLI
if `Aws › Samcli: Location` is not set Aws Toolkit keeps looking in
`C:\\Users\\USERNAME\\AppData\\Local\\Programs\\Microsoft VS Code\\sam`
if sam cli `Aws › Samcli: Location` is not set, I have tried setting the exact location to SAMCLI using
`\\wsl.localhost\Ubuntu-20.04\usr\local\bin\sam` &
`/usr/local/bin/sam`
unfortunately all of the options gives same error
`Error: ENOENT: no such file or directory, stat `
I have verified sam cli is installed and working when using command line
```
sam --version
output: SAM CLI, version 1.65.0
which sam
output: /usr/local/bin/sam
```
## Steps to reproduce the issue
## Expected behavior
It should find sam cli from wsl installed directory.
I installed SAM using command line installer.
## System details (run the `AWS: About Toolkit` command)
- OS: Ubuntu 20.04 on WSL2, Windows 11
- Visual Studio Code version: 1.73.1
- AWS Toolkit version: v1.53.0
Contributor guide
Research direction
Start by reproducing the failure through the AWS: Create Lambda SAM Application command with Aws › Samcli: Location set to /usr/local/bin/sam or the WSL path. Compare that behavior with sam --version and which sam inside Ubuntu 20.04, and verify completion when the toolkit finds the installed SAM CLI instead of showing Get SAM CLI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript, ubuntu, vscode
- Domain
- cli, devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100