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

Inquirer cannot be found #866

Closed
ghaiklor opened this issue Oct 22, 2015 · 4 comments
Closed

Inquirer cannot be found #866

ghaiklor opened this issue Oct 22, 2015 · 4 comments

Comments

@ghaiklor
Copy link

When you moved inquirer to devDependencies you made a mistake. inquirer is using for user prompts. So my tests is failing with error:

Cannot find module inquirer

@ghaiklor
Copy link
Author

Summoning @sindresorhus who has made this change in 11255c7

@kevva
Copy link
Member

kevva commented Oct 22, 2015

Yup, seems like it's needed in

var inquirer = require('inquirer');
.

@ghaiklor
Copy link
Author

@kevva and here -

generator/lib/base.js

Lines 225 to 239 in f8a5fc9

Base.prototype.prompt = function (questions, callback) {
questions = promptSuggestion.prefillQuestions(this._globalConfig, questions);
this.env.adapter.prompt(questions, function (answers) {
if (!this.options['skip-cache']) {
promptSuggestion.storeAnswers(this._globalConfig, questions, answers);
}
if (_.isFunction(callback)) {
callback(answers);
}
}.bind(this));
return this;
};

Base.prototype.prompt = function (questions, callback) {
  questions = promptSuggestion.prefillQuestions(this._globalConfig, questions);

  this.env.adapter.prompt(questions, function (answers) {
    if (!this.options['skip-cache']) {
      promptSuggestion.storeAnswers(this._globalConfig, questions, answers);
    }

    if (_.isFunction(callback)) {
      callback(answers);
    }
  }.bind(this));

  return this;
};

@sindresorhus
Copy link
Member

Sorry about that. I read lib/test/adapter.js as test/adapter.js when grepping for it. Though in all fairness the tests should have caught it. Fixed in 0.21.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants