question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interesting, but annoying docs

See original GitHub issue

I was interested, especially when I read it only takes 11ms to load. I decided to try it out by copying and pasting code from the docs:

var enquirer = require('enquirer');

enquirer.question('first', 'First name?');
enquirer.question('last', 'Last name?');

enquirer.ask('first')
  .then(function(answers) {
    console.log(answers);
  });

But no! How dare I! I get this:

enquirer.question('first', 'First name?');
         ^
TypeError: enquirer.question is not a function

I would’nt have bothered actually, I could read the docs further or take a look at the tests to see whats going on, but I have been trying to get my custom generators working using https://github.com/generate/generate, same devs, same problems, documented examples that don’t work and one has no idea why.

I apologize.

Does anyone know what I am doing wrong? A code example would be nice. Thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jonschlinkertcommented, Aug 30, 2016

Not to keep this going, but when you apologize in the same textbox in which you’re insulting the developers/maintainers of a project (or even two projects), it hard to take as a sincere comment. Perhaps, instead of apologizing, just revise the comment next time? Just a thought…

While I do appreciate getting issues about mistakes in the docs, I try to keep as positive of an attitude as possible, so I was about to close and lock the issue just because of the antagonistic title.

Instead, the issue was closed automatically by a code commit that resolved the issue. I fixed the problematic docs.

You need to instantiate Enquirer:

var Enquirer = require('enquirer');
var enquirer = new Enquirer();

enquirer.question('first', 'First name?');
enquirer.question('last', 'Last name?');

enquirer.ask('first')
  .then(function(answers) {
    console.log(answers)
  });

// errors
enquirer.ask('first')
  .then(function(answers) {
    console.log(answers)
  })
  .catch(function(err) {
    console.log(err)
  });

Also, regarding your comments about generate, you created an issue there about running locally installed generators without installing generate globally. I commented on that issue, we’re working on it. and while I do think that feature should be supported, it’s not something that was prioritized or even thought about before you created the issue. So thank you for the issue.

Going forward, the best way to get what you want from a software project you use, or want to use, is to engage in positive conversation with the maintainers, and maybe even contribute to the project. We do this in our spare time, because we love programming. But I don’t love it when we disparaging comments. Constructive comments are always welcome. It’s more likely to inspire us to stop working on a project than the other way around.

If you don’t have enough time or know javascript well enough to contribute, that’s ok, no one expects you to. But you should also equally respect the fact that you’re not paying us to spend our time helping you or provide you with free software. Just be nice. that’s all we ask.

1reaction
kokujincommented, Aug 30, 2016

Whoa! No code example, or explanation?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Docs: Beat Annoying Collaborators at Their Own Game
Tired of your colleagues' annoying collaboration habits? Try a few of these Google Docs tips to combat them. Be sure to check out...
Read more >
If I have to hear “Get your docs in a row” one more time - Reddit
I have Comedy Central on in the background when I WFH, and this is on all the damn time.
Read more >
Doctors Confess: The 11 Most Annoying Things Patients Do
From smelly feet to overbearing parents, the surprising things that annoy doctors, nurses, pharmacists, and other health care professionals.
Read more >
Google Docs 8 Coolest Features - YouTube
Google Docs tips and tricks.My favourite 8 features in Google Docs.Table of Contents 00:00 Introduction01:09 Document History02:40 Text ...
Read more >
10 annoying Word features (and how to turn them off)
Word can be a little unruly sometimes, making inexplicable changes, inserting text you didn't ask for, and hijacking your formatting.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found