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

deno run fail to execute npm binary file in 2.0 #27114

Open
avallete opened this issue Nov 27, 2024 · 0 comments
Open

deno run fail to execute npm binary file in 2.0 #27114

avallete opened this issue Nov 27, 2024 · 0 comments
Labels
needs investigation requires further investigation before determining if it is an issue or not node compat

Comments

@avallete
Copy link

Describe the bug
Hi there, Andrew from supabase, we've been having report of users failing to use supabase CLI with Deno 2 and running into some error executing the compiled binary.

To Reproduce
Steps to reproduce the behavior:

  1. Have Deno 2 installed
  2. Create a new directory, and run deno init in it
  3. The following content been added to deno.json
{
  # install deps in a node_modules directory 
  "nodeModulesDir": "auto",
  "imports": {
    "supabase": "npm:supabase@^1.223.10"
  }
}
  1. Install deps: deno install --allow-scripts
  2. Try run the CLI with deno run -A npm:supabase --help

Sees the following error in terminal:

❯ deno run -A npm:supabase --help
error: Uncaught SyntaxError: Invalid or unexpected token
    at <anonymous> (file:///Users/folder/node_modules/.deno/supabase@1.219.2/node_modules/supabase/bin/supabase:1:1)

Debug:

Running /Users/folder/node_modules/.deno/supabase@1.219.2/node_modules/supabase/bin/supabase properly execute the binary.

Expected behavior
Deno 2 with deno run command should also be able to run the supabase CLI

Additional context
Opening the issue based on discussion with @bartlomieju on discord: https://discord.com/channels/684898665143206084/1308818534809210930/1309145748264325120

Related: supabase/cli#2900

Version: Deno 2.0.6

@bartlomieju bartlomieju added needs investigation requires further investigation before determining if it is an issue or not node compat labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation requires further investigation before determining if it is an issue or not node compat
Projects
None yet
Development

No branches or pull requests

2 participants