Amplify-cli: Amplify CLI Plugin Scan Failed

Created on 3 Mar 2020  Â·  20Comments  Â·  Source: aws-amplify/amplify-cli

Note: If your question is regarding the AWS Amplify Console service, please log it in the
official AWS Amplify Console forum

Which Category is your question related to?
Amplify CLI Plugin scan failed.

Amplify CLI Version

You can use amplify -v to check the amplify cli version on your system

~/D/4/taskmaster   notifications ±  amplify -v
Scanning for plugins...
Plugin scan failed.
Plugin scan failed.
Error: Plugin scan failed.
at scan (/usr/local/lib/node_modules/@aws-amplify/cli/src/plugin-manager.ts:137:11)
~/D/4/taskmaster   notifications ± 

What AWS Services are you utilizing?

Provide additional details e.g. code snippets

I uninstalled and reinstalled Amplify CLI. Keep getting the same errors over and over.

~/D/4/taskmaster   notifications ±  amplify -v
Scanning for plugins...
Plugin scan failed.
Plugin scan failed.
Error: Plugin scan failed.
at scan (/usr/local/lib/node_modules/@aws-amplify/cli/src/plugin-manager.ts:137:11)
~/D/4/taskmaster   notifications ± 

bug pending-response platform

Most helpful comment

Or, simply

sudo chown -R <user> ~/.amplify

All 20 comments

Hello @martinpapacodes What OS are you installing the CLI on?

macOS Mojave
Version 10.14.6

Don't know why the error is from a ts file.
How did you install the Amplify CLI?

@martinpapacodes I've seen this error when using Node version < 10.x

What's the node version you're using?

I'm having the same issue as OP.
Node version: 12.16.1
NPM version: 6.13.14
yarn version: 1.22.0
OS: Windows 10 Home, Version 1809, OS Build 17763.1039

I installed the amplify cli in my root directory C:\npm install -g @aws-amplify/cli
I successfully got to the post-install.js, "Successfully installed the Amplify CLI...Javascript Getting Started...". Anytime I run an amplify command, I receive the same error as OP. This includes amplify init, amplify -v, etc. This is the same error whether I run them in the root directory or my project directory.

I've tried reinstalling node, npm, yarn, webstorm, and amplify, and have also deleted and re-cloned my project from github. The set-up has worked for other members of my team without issue, but does not work on my environment, although it was working roughly 2 months ago when we began the project. Error started last week when we re-visited the project (I did have to pull it from master this time around.)

Willing to provide any other information necessary to assist with troubleshooting :)

Is there any movement on this? We're having the same issue also.

I have been having same exact problem. I was using amplify cli fine without issue, then suddenly started to receive this error with every amplify command. I have tried uninstalling and reinstalling node, npm, amplify but end up with

amplify configure
Scanning for plugins...
Plugin scan failed.
Plugin scan failed.
Error: Plugin scan failed.
at scan (/usr/local/lib/node_modules/@aws-amplify/cli/src/plugin-manager.ts:137:11)
➜ healthisland git:(develop) amplify -v
Scanning for plugins...
Plugin scan failed.
Plugin scan failed.
Error: Plugin scan failed.
at scan (/usr/local/lib/node_modules/@aws-amplify/cli/src/plugin-manager.ts:137:11)

Hey guys, could you'll please install the latest version of the CLI - 4.14.1 and see if you're having this issue. As a a part of the latest release we clear the esm cache for the amplify CLI which I suspect is causing this issue.

Hi @kaustavghosh06 . unfortunately that didnt do it for me. Here is my output:


Successfully installed the Amplify CLI

Javascript Getting Started - https://aws-amplify.github.io/docs/js/start

Android Getting Started - https://aws-amplify.github.io/docs/android/start

iOS Getting Started - https://aws-amplify.github.io/docs/ios/start

  • @aws-amplify/[email protected]
    updated 1 package in 30.37s
    ➜ healthisland git:(develop) ✗ amplify configure
    Scanning for plugins...
    Plugin scan failed.
    Plugin scan failed.
    Error: Plugin scan failed.
    at scan (/usr/local/lib/node_modules/@aws-amplify/cli/src/plugin-manager.ts:137:11)
    ➜ healthisland git:(develop) ✗ amplify -v
    Scanning for plugins...
    Plugin scan failed.
    Plugin scan failed.
    Error: Plugin scan failed.
    at scan (/usr/local/lib/node_modules/@aws-amplify/cli/src/plugin-manager.ts:137:11)

Steps I took:
C:\ npm -g uninstall @aws-amplify/cli
successfully uninstalled, then
C:\ npm -g install @aws-amplify/[email protected]
reached post install screen (successfully installed the amplify cli, JavaScript getting started...)
C:\ amplify -v
Result: plugin scan failed (same error as before)
C:\mydirectory\myproject
Result: plugin scan failed (same error as before)

No changes with 4.14.1

This issue is blocking some of our new developers from onboarding onto our Amplify-based project.

Any update on this issue?

I've tried on different node versions and different CLI versions and I couldn't reproduce.
I know this is very hacky, but could you please go to this line of the code /usr/local/lib/node_modules/@aws-amplify/cli/src/plugin-manager.ts:137:11, and insert one line of code before it to help us to diagnose?

    print.error(JSON.stringify(e));

After you add the line, do a npm run build at /usr/local/lib/node_modules/@aws-amplify/cli/ .

The exact spot for me was a little different than mentioned, but I think I found the right place for the print statement: (was line 121 for me). It produced the read out:

C:\>amplify -v Scanning for plugins... Plugin scan failed. {"errno":-4048,"code":"EPERM","syscall":"open","path":"C:\\Users\\adamo\\.amplify\\plugins.json"} Plugin scan failed. Error: Plugin scan failed. at scan (C:\Users\adamo\AppData\Roaming\npm\node_modules\@aws-amplify\cli\src\plugin-manager.ts:138:4)

It seems the CLI does not have the permission to open the file ~/.amplify/plugins.json.
This can be caused by reasons like, the file is open by some other program, or you didn't grant the CLI permission to access it.
You can remove that file (which will be regenerated by the CLI upon scan), and then run amplify plugin scan with admin right.

That seems to have solved the problem. @UnleashedMind

@UnleashedMind this worked for me as well. Thank you.

On Wed, Mar 11, 2020 at 1:29 PM Montana notifications@github.com wrote:

That seems to have solved the problem. @UnleashedMind
https://github.com/UnleashedMind

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aws-amplify/amplify-cli/issues/3560#issuecomment-597930285,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AE7S7UVEWYPGDS7HZ5MNOTTRHANEZANCNFSM4LAPRFHQ
.

Looks like its the same issue for everyone on this thread. Please let us know if @UnleashedMind's workaround didn't work for you and we'll re-open the thread.

Unfortunately it started again just days after following @UnleashedMind
workaround. The original problem seems to still need to be addressed.

On Wed, Mar 11, 2020 at 3:11 PM Kaustav Ghosh notifications@github.com
wrote:

Closed #3560 https://github.com/aws-amplify/amplify-cli/issues/3560.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aws-amplify/amplify-cli/issues/3560#event-3121064471,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AE7S7UXVCUCVXV3H3VHFTCLRHAZDPANCNFSM4LAPRFHQ
.

cp ~/.amplify/plugins.json ~/Desktop
sudo rm -rdf ~/.amplify
mkdir ~/.amplify
touch ~/.amplify/plugins.json

Finally, we need copy entity (not file) ~/Desktop/plugins.json to ~/.amplify/plugins.json

That works for me

Note: If ~/.amplify have other files, just copy it as well as plugins.json to Desktop, recreate, and paste entity (not file) to ~/.amplify

Or, simply

sudo chown -R <user> ~/.amplify
Was this page helpful?
0 / 5 - 0 ratings

Related issues

adriatikgashi picture adriatikgashi  Â·  3Comments

darrentarrant picture darrentarrant  Â·  3Comments

ffxsam picture ffxsam  Â·  3Comments

kangks picture kangks  Â·  3Comments

jexh picture jexh  Â·  3Comments