0

I am an intern at my company, I just need to wrap a few things up before I leave. One of the problems I'm having is AWS Cognito, specifically AWS Amplify CLI. My laptop

amplify --version

returns 4.17.1

This is ideal. The office computer is showing me 3.10.0 This is nowhere near ideal since especially when I do

amplify push

the following errors pops up:

Resource Name: UserPoolClientLambda (AWS::Lambda::Function)
Event Type: create
Reason: The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: f6d965b6-e4a6-4a0e-a380-fc07ac950266)

I have tried the following

npm install -g @aws-amplify/cli

I've tried

npm uninstall -g @aws-ampify/cli

restart computer then

npm install -g @aws-amplify/cli

The amplify --version hasn't changed from the old 3.10.0

Can someone help me here?

user12822357
  • 21
  • 1
  • 4

2 Answers2

0

I had the same error myself, but there is a fast solution to it which is not obvious to the AWS novices as myself.

Apparently there can be a console image running an outdated version of the CLI. To fix, do as follows:

  1. Go to build settings
  2. Scroll to bottom, to Build Image Settings
  3. Click [Edit]-button
  4. Click [Add package version override]
  5. Choose Amplify CLI, version latest, and [Save]

The end result should look like this: Build image settings

Then just trigger another build, which takes a couple of minutes. The build takes longer the first time after adding to the backend, such as after adding api or auth, but will be a bit faster in your future builds

Credit goes to @jimtheplant on AWS Amplify Discord community who helped me with this issue

Christoffer
  • 475
  • 4
  • 9
  • I've performed both of these actions, but still get an old version (4.27.3) of the cli whenever I run "amplify version". My global cli package.json in "..\node_modules\@aws-amplify\cli" shows the latest version (4.32.0). I can't find any reference to the old version. But if I run the version command anywhere, I get the old version returned. Anybody have any other suggestions? I'm running on Windows 10. – Morrious Nov 14 '20 at 17:10
0

I had the same problem and solved it by going into ~/.npm/lib/node_modules/@aws-amplify/cli and running node scripts/post-install.js myself.

I'm not sure if that's the intended behaviour or if it's a bug, but I've asked here https://github.com/aws-amplify/amplify-cli/issues/3149#issuecomment-665720866

Tom Greenwood
  • 1,502
  • 14
  • 17