How to get latest version of SAM-CLI on windows

Viewed 4487

I have latest node installed:

node --version
v14.15.0

I installed sam-cli from https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-windows.html

Then i ran following command npm install -g aws-sam-local

When i run:

sam --version 

I get following:

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

I am attempting to invoke aws lambda function locally like following:

sam local invoke

I get following output:

2020/11/11 22:24:18 Successfully parsed template.yml
2020/11/11 22:24:18 Connected to Docker 1.40
2020/11/11 22:24:18 Could not initiate nodejs14.15 runtime: unsupported runtime

What am i missing?

3 Answers

It seems like that your CLI version does not not support node v14.15.0.

I would suggest upgrading your CLI or downgrading your node version, depends on what you want to do.

I faced similar issue. My sam version was SAM CLI, version 1.2.0.

Upgraded to SAM CLI, version 1.35.0 and issue got resolved.

Related