Install AWS Amplify CLI with npm

If your computer has Node Package Manager (npm) installed, go to the next step. If your computer does not npm installed, this article will show the command to install npm with a package manager so install brew (macOS) or Chocolatey (Windows) by following the steps in this article.

Create AWS Account

First things first, you will need an AWS account to configure Amplify CLI and therefore, create one if you do not already have one. You can signup for AWS from here.

Install npm

We will use different package managers for macOS and Windows. For macOS, we will use brew to install npm and for Windows, we will use Chocolatey. Jump to the appropriate section for instructions.

macOS

If using macOS, open Terminal and execute brew install npm to install. You can open Terminal from Spotlight Search or from Application > Other > Terminal.

After installation, test npm by executing the command npm. If npm requires an update, it will give you the command to run in the output.

Windows

For Windows, run administrative PowerShell and execute choco install nodejs.

After installation execute npm and it should respond. If npm has a newer version as shown in the screenshot below, copy and paste the command in your shell and update npm to the latest version.

Install AWS Amplify CLI

Start off by running node -v and npm -v to verify if both meet the prerequisites to install Amplify CLI. As of June 7, 2021, it requires Node.js version 10.x or greater and npm version 6.X or greater.

Now that we have node and npm installed and verified the versions, let’s install Amplify CLI. Run npm install -g @aws-amplify/cli.

Wait until the installation process finishes.

Configure AWS Amplify

Finally, let’s configure AWS Amplify by running amplify configure from the console. Note that this will require to log into your AWS account through the browser and the web page will prompt for your email and password. If you have a company account using single sign-on (SSO), make sure to login before executing the command.

Amazon has made this super simple, so just follow the instructions on the prompt.

I have chosen ap-southeast-2 as the region because I live in Sydney. If you want to use the most economical region and do not care about latency, use us-west-2. You can go through the list of available regions and there location in Amazon’s document but below is also a list for convenience.

CodeLocation
us-east-1US East (N. Virginia)
us-east-2US East (Ohio)
us-west-2US West (Oregon)
eu-west-1Europe (Ireland)
eu-west-2Europe (London)
eu-central-1Europe (Frankfurt)
ap-northeast-1Asia Pacific (Tokyo)
ap-northeast-2Asia Pacific (Seoul)
ap-southeast-1Asia Pacific (Singapore)
ap-southeast-2Asia Pacific (Sydney)
ap-south-1Asia Pacific (Mumbai)
ca-central-1Canada (Central)

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.