denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
95.98k stars 5.31k forks source link

Strange error message if you typo a remote package URL in a single-file script #26169

Open Benaiah opened 4 days ago

Benaiah commented 4 days ago

Version: Deno 2.0.0

Detailed version info:

deno 2.0.0 (stable, release, aarch64-apple-darwin)
v8 12.9.202.13-rusty
typescript 5.6.2

Running deno index.ts with a clean cache (ran deno clean immediately before) in a directory containing only index.ts with the following contents:

import { DB } from "https://deno.land/x/sqlite@3.9.1/mod.ts"

(note: the sqlite@3.9.1 instead of sqlite@v3.9.1 is intentional; that's what triggers this strange and misleading error)

...results in the following error:

deno-experiments % deno -A index.ts
error: unrecognized subcommand

  tip: some similar subcommands exist: 'init', 'lint'
tobylai-toby commented 4 days ago

try deno run xxx

yazan-abdalrahman commented 3 days ago
PS D:\yad\deno> .\target\debug\deno -A  .\main.ts
error: Module not found "https://deno.land/x/sqlite@3.9.1/mod.ts".
    at file:///D:/yad/deno/main.ts:1:20
PS D:\yad\deno> .\target\debug\deno run -A  .\main.ts
error: Module not found "https://deno.land/x/sqlite@3.9.1/mod.ts".
    at file:///D:/yad/deno/main.ts:1:20
PS D:\yad\deno> 

I think it works; it is not a bug.