## 事象 [[AWS SAM CLI]]で`sam init`をすると[[Clone]]中に失敗する。 ```console $ sam --version SAM CLI, version 1.57.0 $ sam init You can preselect a particular runtime or package type when using the `sam init` experience. Call `sam init --help` to learn more. Which template source would you like to use? 1 - AWS Quick Start Templates 2 - Custom Template Location Choice: 1 Choose an AWS Quick Start application template 1 - Hello World Example 2 - Multi-step workflow 3 - Serverless API 4 - Scheduled task 5 - Standalone function 6 - Data processing 7 - Infrastructure event management 8 - Lambda EFS example 9 - Machine Learning Template: 3 Which runtime would you like to use? 1 - dotnet6 2 - dotnetcore3.1 3 - nodejs16.x 4 - nodejs14.x 5 - nodejs12.x Runtime: 3 Based on your selections, the only Package type available is Zip. We will proceed to selecting the Package type as Zip. Based on your selections, the only dependency manager available is npm. We will proceed copying the template using npm. Would you like to enable X-Ray tracing on the function(s) in your application? [y/N]: n Project name [sam-app]: Cloning from https://github.com/aws/aws-sam-cli-app-templates (process may take a moment) Error: Unstable state when updating repo. Check that you have permissions to create/delete files in C:\Users\tadashi-aikawa\AppData\Roaming\AWS SAM directory or file an issue at https://github.com/aws/aws-sam-cli/issues ``` ## 原因 パスの最大長が260文字をオーバーしていたため。 ## 解決方法 https://github.com/aws/aws-sam-cli/issues/4031#issuecomment-1173730737 管理者権限で[[PowerShell]]の以下を実行すればOKとのこと。 ```powershell New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force ``` 実行結果。 ```powershell 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 ``` ## 参考 - [[Windows 10で長いパスを有効]]