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

Better error when relative path to generator does not exist #854

Open
JoshuaKGoldberg opened this issue Jan 24, 2025 · 0 comments
Open

Better error when relative path to generator does not exist #854

JoshuaKGoldberg opened this issue Jan 24, 2025 · 0 comments

Comments

@JoshuaKGoldberg
Copy link

I'm trying to run yo on local repositories without going through npm link and the like. This actually works fine if you pas a path to yo that does exist:

git clone https://github.com/yeoman/generator-generator
yo ./generator-generator/app/index.js
# (after deprecation warnings)
? Your generator name (generator-yotest) 

But if a relative path that doesn't exist is passed, the error message is misleading:

yo ./does/not/exist.js
Error ./does/not/exist.js 

You don't seem to have a generator with the name “undefined” 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 undefined.

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

If yo cannot find the generator, run yo doctor to troubleshoot your system.

Proposal: let's have yo give a specialized error message for a relative path that does not exist? Maybe:

Error ./does/not/exist.js 

The local generator "./does/not/exist.js" does not exist.

Double-check that that local path exists. If yo still cannot find the generator, run yo doctor to troubleshoot your system.
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

1 participant