langium icon indicating copy to clipboard operation
langium copied to clipboard

Hint for Yeoman generator version

Open Lotes opened this issue 1 year ago • 4 comments

I had a bad setup on my system and realized too late that the Yeoman generator was outdated. A hint during the start would be good to be sure which version you are running. You could also add a hint what version is the latest if you like.

My setup was with Volta and Node installed in parallel, with the old generator in NPM. It was not obvious where the generator was coming from.

Lotes avatar Dec 02 '24 20:12 Lotes

You can also run yo without arguments to see all installed generators and update them when necessary.

spoenemann avatar Dec 09 '24 08:12 spoenemann

Yes, but you will not retrieve any version information. That was the point: when you installed the generator globally (like months ago) and run it, you can not be certain which version it was. Reinstalling it globally was not helping me, because it was installed using Volta but used with NPM over Yeoman.

Lotes avatar Dec 09 '24 19:12 Lotes

@Lotes what about printing version info similar to here: https://github.com/TypeFox/monaco-languageclient/blob/main/package.json#L49

This is helpful in CI or local dev context. Something similar could be invoked before calling yo (either with npm run directly from and node context). Useful info could come from the following commands: Global scope:

yo --version
yo --generators

Local scope:

yo --local-only --version
yo --local-only --generators

kaisalmen avatar Dec 10 '24 07:12 kaisalmen

And maybe we should move away from advising people to use npm -g as it leads to such problems. I fell into similar traps before myself and have witnessed others to do so, too.

For all tools manageable with volta (node, npm, pnpm, yarn, ng and yo) I have moved away from any other installation locally for those tools. This makes handling such things a lot easier and more reliable. Sorry, this is not an advertisement it is just a description of a less painful experience. 😉

kaisalmen avatar Dec 10 '24 07:12 kaisalmen