Bug: SAM Installer Configures Path with Space
This is related to/exposed in #1891
Description:
I commented in 1891 that I overcame the error by explicitly setting the --location argument with the full path in double quotes, like this:
sam init --location "C:\Users[my username]\AppData\Roaming\AWS SAM\aws-sam-cli-app-templates\python3.9\cookiecutter-aws-sam-hello-python"
This appears to be happening because the "AWS SAM" folder in the path has a space. Recommend changing to "AWS-SAM" following the rest of the path naming conventions you seem to be following...
Steps to reproduce:
Try sam init without args after installing on windows with current MSI.
Observed result:
You should get:
Error: Unstable state when updating repo. Check that you have permissions to create/delete files in C:\Users[username]\AppData\Roaming\AWS SAM directory or file an issue at https://github.com/aws/aws-sam-cli/issues
Expected result:
Prompting for various arguments.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Windows 11
sam --version: SAM CLI, version 1.53.0- AWS region: us-east-1
Can confirm, I'm getting the same error when using sam init.
It is required to opt in to remove the MAX_PATH limitation. Please follow here for the instructions.
Closing as duplicate of #4031
same issue here: my return message:
PS C:\Windows\system32> New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
>> -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
LongPathsEnabled : 1
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
PSChildName : FileSystem
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry