yeoman / yo

CLI tool for running Yeoman generators
http://yeoman.io
BSD 2-Clause "Simplified" License
3.85k stars 399 forks source link

Suggestion for installing scoped generator is wrong #518

Closed Jameskmonger closed 7 years ago

Jameskmonger commented 7 years ago

Type of issue

Bug


My environment

Expected behavior

Attempting to run a scoped generator (e.g. yo @somescope/somegen) should tell the user how to install it if it doesn't exist. The npm install suggestion should be npm install @somescope/generator-somegen.

Current behavior

The message is npm install generator-@somescope/somegen.

Steps to reproduce the behavior

Run yo @foo/bar when you do not have @foo/generator-bar installed.

Command line output

λ yo @foo/bar
Error @foo/bar

You don’t seem to have a generator with the name “@foo/bar” installed.
But help is on the way:

You can see available generators via npm search yeoman-generator or via http://yeoman.io/generators/.
Install them with npm install generator-@foo/bar.

To see all your installed generators run yo without any arguments. Adding the --help option will also show subgenerators.

If yo cannot find the generator, run yo doctor to troubleshoot your system.
SBoudrias commented 7 years ago

PR welcomed, it should be an easy fix on that line: https://github.com/yeoman/environment/blob/566db2a04fec5ab525b63aca0d600ecef5510b9d/lib/environment.js#L343

elevenpassin commented 7 years ago

Can you guys please close the issues that are fixed

mischah commented 7 years ago

@buoyantair We try to. But it’s kinda hard to keep track of every single issue within the yeoman organisation.

So any help really is appriciated. Even if you just leave a note like to did in here.

So, thank you for pointing to this.

rodoabad commented 5 years ago

Can scoped generators just be @foo/generator?