AWS is not recognized as an internal or external command, operable command, or batch file

46    Asked by DavidPiper in AWS , Asked on May 9, 2024

 I am currently engaged in a particular task that is related to setting up a development environment on a new computer however I have encountered the error message “aws is not recognized as an internal or external command, operable command or batch file.” When trying to use the AWS command line interface. How can I troubleshoot and resolve this particular issue? 

Answered by Colin Payne

 In the context of AWS, here are the steps given for how you can troubleshoot and resolve your particular Issue:-

Checking AWS CLI installation

First, you should ensure that you have the AWS CLI in your particular system. If not installed then you can install the AWS CLI from the official AWS website.

Verify environment variables

You can check if the AWS CLI executable path is included in your system's PATH environment variable.

Update the PATH Variable

You can also add manually the AWS CLI directory in your PATH if it is not presented.

Restart the terminal or command prompt

After updating the PATH Variable, you can close and re-open your terminal or command prompt windows to apply the changes.

Verify the AWS CLI installation

Once you have updated the PATH you can run “aws --- version” again in your terminal or even command prompt so that you can verify that the AWS CLI is now recognized as a command.

For Windows

REM Step 1: Check AWS CLI Installation
Aws –version
REM Step 2: Verify Environment Variables
Echo %PATH%
REM Step 3: Update PATH Variable (if needed)
Setx PATH “%PATH%;C:Program FilesAmazonAWSCLI”
REM Step 4: Restart Command Prompt
REM Close the current command prompt window and reopen it
REM Step 5: Verify AWS CLI Installation (Again)
Aws –version
For UNIX based system
# Step 1: Check AWS CLI Installation
Aws –version
# Step 2: Verify Environment Variables
Echo $PATH
# Step 3: Update PATH Variable (if needed)
Echo ‘export PATH=/usr/local/bin/aws:$PATH’ >> ~/.bashrc
Source ~/.bashrc
# Step 4: Restart Terminal
# Close the current terminal window and reopen it
# Step 5: Verify AWS CLI Installation (Again)
Aws –version

Here is the coding structure given in HTML which can guide you through the steps or looking into the steps for solving the issue of AWS is not recognised:-




<meta</span> charset=”UTF-8”>

<meta</span> name=”viewport” content=”width=device-width, initial-scale=1.0”>

AWS CLI Troubleshooting



  AWS CLI Troubleshooting

 


       

  1. Check AWS CLI Installation: Open a terminal or command prompt and run aws –version.

  2.    

  3. Verify Environment Variables: Run echo %PATH% (Windows) or echo $PATH (Unix-based systems) to view the PATH variable’s contents.

  4.    

  5. Update PATH Variable (if needed):

         


             

    • Windows: Add the AWS CLI directory path to the PATH variable using setx PATH “%PATH%;C:Program FilesAmazonAWSCLI”.

    •        

    • Unix-based: Edit ~/.bashrc or ~/.bash_profile to include export PATH=/usr/local/bin/aws:$PATH and then run source ~/.bashrc to apply the changes.

    •      


       


  6.    

  7. Restart Terminal or Command Prompt: Close and reopen the terminal or command prompt.

  8.    

  9. Verify AWS CLI Installation (Again): Run aws –version to check if the AWS CLI is recognized as a command.

  10.  






Your Answer

Interviews

Parent Categories