Search code examples
aws-amplifyaws-amplify-cli

How to reinstall amplify?


I installed amplify with curl -sL https://aws-amplify.github.io/amplify-cli/install | bash && $SHELL.

Then I tried amplify configure from VS code. The command was not found. I tried to reinstall by uninstalling amplify.

Tried to reinstall amplify from VS code terminal with npm install -g @aws-amplify/cli I get this error.

npm WARN ERESOLVE overriding peer dependency
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/@aws-amplify/cli
npm ERR! dest /usr/local/lib/node_modules/@aws-amplify/.cli-mpkUHmII
npm ERR! errno -66
npm ERR! ENOTEMPTY: directory not empty, rename '/usr/local/lib/node_modules/@aws-amplify/cli' -> '/usr/local/lib/node_modules/@aws-amplify/.cli-mpkUHmII'

how do i fix this?


Solution

  • To fix it, you have to follow what npm suggest you, rename the @aws-amplify/cli directory (because is not empty).

    From command line run this:

    sudo mv /usr/local/lib/node_modules/@aws-amplify/cli /usr/local/lib/node_modules/@aws-amplify/.cli-mpkUHmII
    

    And again:

    npm install -g @aws-amplify/cli