apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
60.53k stars 13.07k forks source link

Yeoman Generator @superset-ui/superset Fails with Environment Compatibility Error #26352

Open NurramoX opened 6 months ago

NurramoX commented 6 months ago

When attempting to use the Yeoman generator @superset-ui/superset for creating a custom Superset plugin, an error occurs stating that the current environment does not provide some necessary feature that the generator needs. The error message doesn't tell exactly which feature it needs... This issue arises after following the steps provided in the Preset blog for building custom visualization plugins in Superset. The expected behavior is to receive a prompt from the generator asking a few questions, but instead, an error is encountered.

How to reproduce the bug

npm i -g yo
cd superset-frontend/packages/generator-superset
npm i && npm link
mkdir /tmp/superset-plugin-chart-hello-world
cd /tmp/superset-plugin-chart-hello-world
yo @superset-ui/superset

Expected results

The generator should prompt the user with questions to set up the new Superset plugin.

Actual results

An error message is displayed: Error @superset-ui/superset Current environment doesn't provide some necessary feature this generator needs.

Environment

Checklist

Additional context

Downgrading Yeoman to version 4 (npm i -g yo@4) resolves the issue. It seems that the current version of @superset-ui/superset generator may not be compatible with Yeoman version ^5.0.0.

gaogaoinvincible commented 6 months ago

Same error, anybody relove this problem?

visharavana commented 6 months ago

@gaogaoinvincible I am also facing this error. Try this command; it's working for me. -> npm i -g yo -> npm i -g @superset-ui/generator-superset

Stefan781 commented 5 months ago

I ran into the same issue. Downgrading to the latest 4.x.x version was a workaround.

srlee056 commented 5 months ago

@visharavana I faced same error and npm i -g @superset-ui/generator-superset worked for me. Thanks!

loretoparisi commented 4 months ago

npm i -g @superset-ui/generator-superset

amazing it worked in that way:

Install Plugin Generator (Yo)

npm i -g yo
npm i -g @superset-ui/generator-superset

cd superset-frontend/packages/generator-superset
npm i && npm link

Create Example Plugin

mkdir /tmp/superset-plugin-chart-hello-world
cd /tmp/superset-plugin-chart-hello-world
yo @superset-ui/superset
rusackas commented 4 months ago

Happy to update blogs/docs if better instructions would help others. Let me know what you think on that front.

Also open to PRs that will make things work better with Yeoman 5... it's probably time to make that upgrade.

I'm kind of on the fence about whether the yeoman generator is even the right approach here anymore (it's difficult to maintain). There are other ways, like maybe (1) a template repository, (2) a zip file in the repo with a demo plugin, maybe including a little script to add it to Superset, or (3) just a "hello world" plugin sitting there in the monorepo, with tests and storybook running against it as if it were a production plugin (but not installed in Superset).

I've been meaning to have this conversation with @villebro but he's a busy guy ;)