Amplify configure

Viewed 12011

I have installed 'amplify-cli'. When I type 'amplify configure', I get the error message:

'amplify is not recognized as an internal or external command, operable program or batch file'.

7 Answers

Please share your platform. Are you developing on Linux, Windows (Powershell), or Linux on Windows (WSL/Ubuntu)?

Did you install the CLI globally?

Try this:

npm install -g @aws-amplify/cli

And see if that works. If the global install fails, you can try running this per an Amplify developer:

npm install -g @aws-amplify/cli --unsafe-perm=true

Edit: since you're on Windows, it's possible the CLI wasn't added to your $PATH variable. You can fix it by seeing this Github issue.

To solve this, simply edit a PATH key under system Environment Variables and add a new path pointing to amplify:

C:\Users\{UserName}\AppData\Roaming\npm\amplify.cmd

If you have globally installed amplify/cli then you should find two files named amplify and amplify.cmd in the above mentioned npm directory.

Under same circumstances I run all the suggested solutions on Windows 10 machine (64 bit). None of them seemed to do the trick. I got a more specific error:

..... cannot be loaded because running scripts is disabled on this system .... + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess

The issue appears due to Windows PowerShell execution policies. Eventually, I managed to amend it by applying the following:

C:\Windows\System32>powershell Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

Above solutions didn't work for me, I had to run this instead of 'amplify init':

C:\Users{UserName}\AppData\Roaming\npm\amplify init

I had the same issue and my problem was because I was trying to install it using

yarn global add @aws-amplify/cli

Apparently, it doesn't work when it is installed with yarn it has to be npm. It's funny because there are no errors shown. There might be a fix to it maybe someone can look into that.

If you are on windows platform avoid using the global(-g) flag from your npm command. Install Amplify CLI with below npm command.

npm install @aws-amplify/cli

It worked for me.

Error:

amplify : The term 'amplify' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. le program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • amplify init
    • CategoryInfo : ObjectNotFound: (amplify:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Try this for windows:

Step 1:

npm install -g @aws-amplify/cli --unsafe-perm=true

Step 2:

npm config get prefix

Step 3:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

you must run this code on PowerShell not a cmd.

Related