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

interactive prompts and permission prompts interact badly #17047

Open
ry opened this issue Dec 14, 2022 · 2 comments
Open

interactive prompts and permission prompts interact badly #17047

ry opened this issue Dec 14, 2022 · 2 comments
Labels
bug Something isn't working correctly node compat

Comments

@ry
Copy link
Member

ry commented Dec 14, 2022

In this example with Deno 1.28.3 I get prompted for permissions to /etc/npm/config and for What is your project named? at the same time

# deno run npm:create-next-app@latest
✅ Granted read access to <main_module>.
✅ Granted env access to "FORCE_COLOR".
✅ Granted env access to "CI".
✅ Granted env access to "TEAMCITY_VERSION".
✅ Granted env access to "COLORTERM".
✅ Granted env access to "NODE_DISABLE_COLORS".
✅ Granted env access to "TERM".
✅ Granted env access to "OSTYPE".
✅ Granted env access to all.
✅ Granted read access to <CWD>.
✅ Granted read access to "/var/folders/9v/kys6gqns6kl8nksyn4l1f9v40000gn/T/update-check".
✅ Granted write access to "/var/folders/9v/kys6gqns6kl8nksyn4l1f9v40000gn/T/update-check".
? What is your project named? › ⚠️  ┌ Deno requests read access to "/etc/npm/config".
   ├ Requested by `Deno.readFileSync()` API
   ├ Run again with --allow-read to bypass this prompt.
   └ Allow? [y/n] (y = yes, allow; n = no, deny) >

The program hangs here. It's not even possible to ctrl+c or ctrl+d out of it.

@ry ry added the bug Something isn't working correctly label Dec 14, 2022
@ktfth
Copy link
Contributor

ktfth commented Dec 19, 2022

Trying to understand to help on this issue, the prompt of npm mechanism is better to occur after permissions prompt?

@bartlomieju
Copy link
Member

Trying to understand to help on this issue, the prompt of npm mechanism is better to occur after permissions prompt?

It's unclear - we first should debug to see what's the order of events - from the quick glance of the output above it appears that the prompt from npm module is displayed and then some async action triggers Deno's permission prompt. We should collect a few scenarios when such situation happen to try and establish if we can handle all of them (or some of them) and then think on a way to handle it. I think it might be very tricky to resolve this issue fully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

3 participants