I try to use 'sam build' for AWS lambda and I get error:
Build Failed Error: DotnetCliPackageBuilder:GlobalToolInstall - Error configuring the Amazon.Lambda.Tools .NET Core Global Tool: Dotnet CLI Failed: Tool 'amazon.lambda.tools' failed to update due to the following: Failed to create shell shim for tool 'amazon.lambda.tools': Command 'dotnet-lambda' conflicts with an existing command from another tool. Tool 'amazon.lambda.tools' failed to install.
If they conflict then I am eager to delete one of them. But how? I tried to update amazon.lambda.tools: dotnet tool install --global Amazon.Lambda.Tools --version 5.0.0
I get error: Failed to create shell shim for tool 'amazon.lambda.tools': Command 'dotnet-lambda' conflicts with an existing command from another tool. Tool 'amazon.lambda.tools' failed to install.
When I pass "dotnet-lambda" in CMD I get information: The application to execute does not exist: 'C:......dotnet\tools.store\amazon.lambda.tools\5.0.0\amazon.lambda.tools\5.0.0\tools\netcoreapp2.1\any\dotnet-lambda.dll'.
I reinstalled sam-cli and no effect.
It was working in C#, 'sam build' was working and then it stopped. In Git I didn't see any strange change. No idea why. Please help
As it was critical for me I tried various methods to solve it. Problem is with newer amazon.lambda.tools version 5.0.0. Due to error in console, I deleted manually newer version. .dotnet\tools.store
Later I installed previous version. Downgrading to version lower solved my issue.
It's interesting topic for me, is it best practice to use 'sam build' or use other methods to build and deploy lambda?