Aws-sam-cli: sam local update

Created on 17 Apr 2019  路  17Comments  路  Source: aws/aws-sam-cli

sam --version
A newer version of the AWS SAM CLI is available!
Your version: 0.2.11
Latest version: 0.15.0
See https://github.com/awslabs/aws-sam-local for upgrade instructions

i am getting this link to upgrade the sam cli version but i am unable to find the instructions. When i try to install it with pip, i face difficulties. Please help!!

Most helpful comment

@AggarwalKunal It is kind of hidden in the Update section here.

You will need to uninstall the npm version.

npm uninstall -g aws-sam-local

You should then be able to follow the your OS Installation instructions

All 17 comments

@TheSriram https://github.com/awslabs/aws-sam-cli/releases please tell me how to update via npm. or how to update via these files.

@AggarwalKunal you can install new version using brew for MacOS/Linux, or download MSI-package for Windows, or install it using pip. Instructions and links are available here.
However there are not version for npm. I think npm is not supported anymore.

but when i tried to install it with pip, sam local start-api doesn't worked.

You should add it into your $PATH variable. You could find it by following path:
C:\Users\<Your_Username>\AppData\Roaming\Python\Python37\Scripts

currently i am working in ubuntu.

Ok, try to find out where are placed scripts installed by pip. I don't have a computer with Linux installed, and can't do it. But I also have installed this version by pip, added it into $PATH, and it works for me.
Maybe it helps. Run in terminal, and command shows you where sam is placed:
pip show aws-sam-cli

python user base path : /home/force-laptop-13/.local/bin

Have you sam-command in this directory?
If answer is true, add it into your $PATH variable.
Maybe this this topic will help you make it.

i will see it and respond to you tomorrow.

@AggarwalKunal It is kind of hidden in the Update section here.

You will need to uninstall the npm version.

npm uninstall -g aws-sam-local

You should then be able to follow the your OS Installation instructions

@jfuss yup, you are right but npm doesn't have the latest verion of aws-sam-cli and pip doesn't start aws-sam-cli properly.
when we type : sam local start-api, it gives:
Error:

@AggarwalKunal We don't publish to npm anymore (and haven't for about a year).

Looks like you are installing into Python2.7. If you instead install into Python3.6+, you should see what is going on (there is a bug with some of our output in Python2.7). It is probably something with your template, if I remember how this occurs.

Brew is the go to method on mac to install aws-sam-cli and MSI for windows. Unistall the npm based install of aws-sam-cli, its really old and is not going to be updated going forward.

sam local start-api
Error: [InvalidResourceException('lambdasrc', 'property timeout not defined for resource of type AWS::Serverless::Function'), InvalidResourceException('apartmentsrc', 'property timeout not defined for resource of type AWS::Serverless::Function')] ('apartmentsrc', 'property timeout not defined for resource of type AWS::Serverless::Function') ('lambdasrc', 'property timeout not defined for resource of type AWS::Serverless::Function')

installed through pip3

Thanks all.....

sudo -H pip install aws-sam-cli to install sam globally using pip

Was this page helpful?
0 / 5 - 0 ratings