Skip to content

Commit 019af2d

Browse files
mischahSBoudrias
authored andcommitted
Improve error message when generator not found (yeoman#70)
* Improve error message when generator not found Closes yeoman/yo#388 * Updates formatting of error message * Improves error message
1 parent 73250da commit 019af2d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/environment.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,14 @@ Environment.prototype.create = function create(namespace, options) {
298298
if (!_.isFunction(Generator)) {
299299
return this.error(
300300
new Error(
301-
'You don\'t seem to have a generator with the name ' + namespace + ' installed.\n' +
302-
chalk.bold('You can see available generators with ' + 'npm search yeoman-generator') +
303-
chalk.bold(' and then install them with ' + 'npm install [name]') + '.\n' +
304-
'To see the ' + this.namespaces().length + ' registered generators run yo with the `--help` option.'
301+
chalk.red('You don\’t seem to have a generator with the name “' + namespace + '” installed.') + '\n' +
302+
'But help is on the way:\n\n' +
303+
'You can see available generators via ' +
304+
chalk.yellow('npm search yeoman-generator') + ' or via ' + chalk.yellow('http://yeoman.io/generators/') + '. \n' +
305+
'Install them with ' + chalk.yellow('npm install generator-' + namespace) + '.\n\n' +
306+
'To see all your installed generators run ' + chalk.yellow('yo') + ' without any arguments. ' +
307+
'Adding the ' + chalk.yellow('--help') + ' option will also show subgenerators. \n\n' +
308+
'If ' + chalk.yellow('yo') + ' cannot find the generator, run ' + chalk.yellow('yo doctor') + ' to troubleshoot your system.'
305309
)
306310
);
307311
}

0 commit comments

Comments
 (0)