2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Cloud9でデバッグ時の「A newer version of the AWS SAM CLI is available!」を解決する方法 +「Unsupported lambda runtime nodejs14.x」も

Last updated at Posted at 2019-08-27

🔷現象

Cloud9でLambda用のNode.jsのプログラムを書いていると、時々起こる現象です。

Cloud9でデバッグを行うと、「A newer version of the AWS SAM CLI is available!」という文言が表示されて、デバッグが実行できない。

スクリーンショット 2019-08-27 15.46.12.png

もしくは、「Unsupported lambda runtime nodejs14.x」みたいな、ランタイムがサポートされていなくて、デバッグが実行できない。
スクリーンショット 2022-01-27 10.12.15.png

🔷原因

ログに書いてある事が全てです。
Cloud9で使っているAWS SAM CLIのバージョンが古く、AWS SAMが持っているNode.jsのランタイムのバージョンが対応しておらず、エラーになっています。

A newer version of the AWS SAM CLI is available!
Your version:   0.2.11
Latest version: 0.19.0
See https://github.com/awslabs/aws-sam-local for upgrade instructions
2019/08/27 06:49:39 Successfully parsed template.yaml
2019/08/27 06:49:39 Connected to Docker 1.38
2019/08/27 06:49:39 Could not initiate nodejs10.x runtime: unsupported runtime

🔷解決方法

Cloud9の画面下に開かれているコンソールに、以下のコマンドを入力して、SAM CLIのバージョンアップを行う。

 pip install --user --upgrade aws-sam-cli

以下のコマンドで、SAM CLIが利用できるように、シンボリックリンクを変更する。

ln -sf $(which sam) ~/.c9/bin/sam

これで、最新のAWS SAM CLIが有効になり、デバッグができるようになります。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?