enquirer icon indicating copy to clipboard operation
enquirer copied to clipboard

Enquirer is stuck

Open mayank1513 opened this issue 1 year ago • 3 comments

I use enquirer. It was working fine. But it is no longer working.

Code is stuck here. I am using VScode on Win 11.

Repo -> https://github.com/react18-tools/turborepo-template/ File -> scripts/rebrand.js

  const { shouldRebrand } = await prompt({
    type: "confirm",
    name: "shouldRebrand",
    message: "Do you want to rebrand this repo?",
    initial: true,
  });

It only shows Running... in the terminal.

mayank1513 avatar Jun 16 '24 15:06 mayank1513

Ok. It works when I run the script from terminal, like node scripts/rebrand.js. But I have added the script as preinstall. "preinstall": "node scripts/update-pm.js"

So when I install the dependencies, it gets stuck. Please note that you need to comment out line number 15 to run the script.

mayank1513 avatar Jun 16 '24 15:06 mayank1513

Hmm, prompt is being called at the bottom of rebrand.js but it's not being awaited. I'm not sure what else might be causing it.

jonschlinkert avatar Jun 16 '24 23:06 jonschlinkert

The culprit seems to be running it as preinstall script. It runs normally otherwise. And I have tested removing the last prompt as well.

mayank1513 avatar Jun 17 '24 01:06 mayank1513

K, sounds like this is technically resolved then. I'll go ahead and close. Let us know if you want to discuss further.

jonschlinkert avatar Jul 12 '24 10:07 jonschlinkert