Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator broken after updating to 5.0.0 #1279

Closed
fernandopasik opened this issue Feb 21, 2021 · 22 comments
Closed

Generator broken after updating to 5.0.0 #1279

fernandopasik opened this issue Feb 21, 2021 · 22 comments

Comments

@fernandopasik
Copy link

I'm getting this error after upgrading to yeoman-generator 5.0.0

Error mygenerator 

This generator (mygenerator) requires yeoman-environment at least 3.0.0-beta.1, current version is 2.10.3
@fernandopasik fernandopasik added the needs triage Awaiting triage label Feb 21, 2021
@fernandopasik
Copy link
Author

@mshima I saw you upgraded a few libraries besides this one. Do you know what this could be related to?

@fernandopasik
Copy link
Author

fernandopasik commented Feb 21, 2021

I tried forcing environment 3.0.0 on my dependencies, but still was pointing to 2.10.3.

After some more investigation I noticed that is actually the version that yo is using in my global packages.

Should we update https://github.com/yeoman/yo/blob/main/package.json#L74 ?

@mshima
Copy link
Member

mshima commented Feb 21, 2021

@fernandopasik yeoman-generator@5 requires a new version of yo. I will update it, but not sure the timeline. First time I've released a version that required a new yo release.
For now I recommend it for generators that includes it's own executable or you can test it using yeoman-environment own binary (new): npm install -g yeoman-environment; yoe run a-generator.

@fernandopasik
Copy link
Author

Makes sense, thanks for clarifying and the help

@mshima
Copy link
Member

mshima commented Mar 8, 2021

Beta released npm install yo@next-4

@mshima mshima removed the needs triage Awaiting triage label Mar 8, 2021
@haixiangyan
Copy link

haixiangyan commented Mar 16, 2021

Same problem here. +1. Updating to yo@next-4 solved my problem.

Try so many times to uninstall and install the yo package. God, I thought my nvm or npm was broken 🤣

Hope this could be fixed in the official version. Thx.

@LandonSchropp
Copy link

I'm running into the same issue. I'm don't mean to sound ungrateful, because Yeoman is awesome, but I wish that these changes would have been released simultaneously. This issue wasn't easy to find on Google.

@mshima
Copy link
Member

mshima commented Mar 20, 2021

@LandonSchropp yeoman-generator/yeoman-environment/yo relationship is quite unique.
But yo keeps ancient backward compatibility.
Those new releases are quite stable for standalone generators, but there are a few details that may require changes for a better backward compatibility/interoperability.

@github-actions
Copy link
Contributor

This issue is stale because it has been open with no activity. Remove stale label or comment or this will be closed

@github-actions github-actions bot added the stale label Apr 20, 2021
@fernandopasik
Copy link
Author

Any updates on when Yeoman v4.0.0 final will be released?
I know there's the v4.0.0-beta.0 which works good with this release

@github-actions github-actions bot removed the stale label Apr 21, 2021
@mshima
Copy link
Member

mshima commented Apr 22, 2021

yo@4.0.0 is released, hopefully there won't be too many regressions.

@mshima mshima closed this as completed Apr 22, 2021
@fdelbrayelle
Copy link

I still have the issue when working on Kafka module for JHipster :

Uncaught Error: This generator (jhipster-kafka:app) requires yeoman-environment at least 3.0.0, current version is 2.10.3, try reinstalling latest version of 'yo' or use '--ignore-version-check' option

Even if installing yo@latest. Any idea @mshima please?

@mshima
Copy link
Member

mshima commented May 19, 2021

@fdelbrayelle what command are you executing?

@fdelbrayelle
Copy link

@mshima npm install yo@latest then npm test and I get this error.

@mshima
Copy link
Member

mshima commented May 19, 2021

Update yeoman-test and install yeoman-environment at devDependencies.

@fdelbrayelle
Copy link

Solved! Thank you 🙏

@fdelbrayelle
Copy link

@mshima I've got another error in the same build which seems related to Yeoman Generator : this.installDependencies is not a function. Any idea please 🙏 ?

@mshima
Copy link
Member

mshima commented May 20, 2021

@fdelbrayelle #1283

@fdelbrayelle
Copy link

@mshima Thank you but I don't understand what am I suppose to modify here?

        const installConfig = {
            bower: false,
            npm: this.clientPackageManager !== 'yarn',
            yarn: this.clientPackageManager === 'yarn',
            callback: injectDependenciesAndConstants
        };
        if (this.options['skip-install']) {
            this.log(logMsg);
        } else {
            this.installDependencies(installConfig);
        }

Use add*Dependency instead?

@mshima
Copy link
Member

mshima commented May 20, 2021

@fdelbrayelle if there are dependencies to add, yes.
Otherwise just drop it.

@fdelbrayelle
Copy link

fdelbrayelle commented May 21, 2021

@mshima I don't understand because this.installDependencies(installConfig) (used in generator-jhipster-module that I used to primarly generate the Kafka module) was launching a npm install here. As it was deleted from Yeoman Generator latest version, now I cannot use instead this.addNpmDependency(...) which doesn't seem to launch a npm install. What am I suppose to use instead to launch this one?

Thank you 🙏

@fdelbrayelle
Copy link

I've found another way 😅 fdelbrayelle/generator-jhipster-kafka@eaea3e1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants