A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/aws-amplify/amplify-cli/issues/10180 below:

Can't add third-party NPM plugins since Amplify CLI v8.0.0 · Issue #10180 · aws-amplify/amplify-cli · GitHub

Before opening, please confirm: How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

14.19.1 (but I checked and the error is also there for v16.14.2, so seems Node version doesn't affect it)

Amplify CLI Version

8.0.0

What operating system are you using?

Ubuntu, Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Amplify Categories

Not applicable

Amplify Commands

add

Describe the bug

I'm one of the authors of this third-party Amplify plugin: https://www.npmjs.com/package/amplify-graphql-seed-plugin

In previous versions of the Amplify CLI, our users could install our plugin using NPM directly following the method described in the following official Amplify documentation:

npm install -g amplify-graphql-seed-plugin
amplify plugin add amplify-graphql-seed-plugin

However, since Amplify CLI version 8.0.0, this is no longer working. Instead, when running the same commands, the following error emerges:

$ npm install -g amplify-graphql-seed-plugin
$ amplify plugin add amplify-graphql-seed-plugin
Can not locate the plugin package.
? Enter the absolute path for the root of the plugin directory:

This is not an issue with our Plugin specifically, as e.g. this plugin can't be added either.

Two workarounds described below:

Expected behavior
$ npm install @aws-amplify/cli
$ npm install -g amplify-graphql-seed-plugin
$ amplify plugin add amplify-graphql-seed-plugin
Plugin package found.
/home/ec2-user/.nvm/versions/node/v16.14.2/lib/node_modules/amplify-graphql-seed-plugin
? Confirm to add the plugin package to your Amplify CLI. Yes
Successfully added plugin package.

(note: tested this with node v16 as well, had to explicitly install 7.6.26 to make it work)

Reproduction steps

Steps:

  1. npm install @aws-amplify/cli (to install version 8.0.0)
  2. npm install -g amplify-graphql-seed-plugin (to install our plugin - link to NPM / GitHub)
  3. amplify plugin add amplify-graphql-seed-plugin

Output:

Can not locate the plugin package.
? Enter the absolute path for the root of the plugin directory:
GraphQL schema(s)

No response

Log output

Don't think there's anything meaningful in here, but for completeness:

For version 7.6.26

# Put your logs below this line
2022-04-10T20:14:45.547Z|info : amplify plugin core add amplify-graphql-seed-plugin 
2022-04-10T20:14:45.608Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}

For version 8.0.0

2022-04-10T20:17:06.206Z|info : amplify version core  
2022-04-10T20:17:16.469Z|info : amplify plugin core add amplify-graphql-seed-plugin 
2022-04-10T20:17:16.510Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
Additional information Workaround 1:

"Workaround" -> downgrade Amplify version:

npm install -g @aws-amplify/cli@7.6.26 
npm install -g amplify-graphql-seed-plugin
amplify add plugin amplify-graphql-seed-plugin

Output:

Plugin package found.
/home/ec2-user/.nvm/versions/node/v16.14.2/lib/node_modules/amplify-graphql-seed-plugin
? Confirm to add the plugin package to your Amplify CLI. Yes
Successfully added plugin package.
Workaround 2:

This works, but is undesirable - it increases complexity for the user, and makes it more difficult to integrate this in CI/CD pipelines. As running NPM packages worked quite well.

git clone https://github.com/awslabs/amplify-graphql-seed-plugin
cd amplify-graphql-seed-plugin
npm install
amplify plugin add
<provide full path to plugin>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4