Skip to content

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

Open
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions