{"record":{"id":"3df9c9c52b7df9fb","repo":"denoland/deno","slug":"is-missing-a-prefix-deno-3-0-requires-bef","errorCode":null,"errorMessage":"{} is missing a prefix. Deno 3.0 requires `--` before script arguments in `deno install -g`. Did you mean `deno install -g {} -- {}`? Or maybe provide a `jsr:` or `npm:` prefix?","messagePattern":"(.+?) is missing a prefix\\. Deno 3\\.0 requires `--` before script arguments in `deno install -g`\\. Did you mean `deno install -g (.+?) -- (.+?)`\\? Or maybe provide a `jsr:` or `npm:` prefix\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/installer/global.rs","lineNumber":127,"sourceCode":"  // Validate every entry and default unprefixed bare package names to the npm\n  // registry (matching `deno add` and local `deno install`) before installing\n  // anything, so an error on entry N doesn't leave entries < N installed.\n  let module_urls: Vec<String> = install_flags_global\n    .module_urls\n    .iter()\n    .enumerate()\n    .map(|(i, module_url)| -> Result<String, AnyError> {\n      let entry_text = module_url;\n      if cli_options.initial_cwd().join(entry_text).exists() {\n        return Ok(module_url.clone());\n      }\n      // Migration error for users coming from Deno < 3.0 who passed script\n      // args without `--`.\n      if i == 1\n        && install_flags_global.args.is_empty()\n        && Url::parse(entry_text).is_err()\n      {\n        bail!(\n          concat!(\n            \"{} is missing a prefix. Deno 3.0 requires `--` before script arguments in `deno install -g`. \",\n            \"Did you mean `deno install -g {} -- {}`? Or maybe provide a `jsr:` or `npm:` prefix?\",\n          ),\n          entry_text,\n          &install_flags_global.module_urls[0],\n          install_flags_global.module_urls[1..].join(\" \"),\n        );\n      }\n      if let Ok(Err(package_req)) =\n        crate::tools::pm::AddRmPackageReq::parse(entry_text, None)\n      {\n        return Ok(format!(\"npm:{package_req}\"));\n      }\n      Ok(module_url.clone())\n    })\n    .collect::<Result<_, _>>()?;\n","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/denoland/deno/blob/a961cdec3b1948844414ebeecc697dcad76df2d1/cli/tools/installer/global.rs#L109-L145","documentation":"Deno 3.0 migration error for `deno install -g`. Before 3.0, script arguments could follow the module without a separator; now they must come after `--`. When the second positional is not a URL, not an existing local file, and no `--` args were given, Deno assumes you passed a pre-3.0-style script argument and tells you how to rewrite the command instead of silently treating the word as a package.","triggerScenarios":"Conditions at cli/tools/installer/global.rs:127: exactly the 2nd module_url (i == 1), install_flags_global.args is empty (no `--` used), Url::parse fails on the entry (e.g. '8000'), and it is not an existing path relative to the initial cwd. Example: `deno install -g jsr:@std/http/file-server 8000`.","commonSituations":"Upgrading a project or docs/CI scripts from Deno 1.x/2.x to 3.x; muscle-memory invocations like `deno install -g file_server 8080` copied from old READMEs; install scripts in Dockerfiles that never used `--`.","solutions":["Insert `--` before script arguments: `deno install -g <module> -- 8000`","If the second word is actually another package, give it a prefix: `deno install -g jsr:... npm:...`","If it is a local file, run from the directory containing it (the existence check is relative to cwd)"],"exampleFix":"# before (Deno 2.x style)\ndeno install -g jsr:@std/http/file-server 8000\n\n# after (Deno 3.x)\ndeno install -g jsr:@std/http/file-server -- 8000","handlingStrategy":"validation","validationCode":"# reject pre-3.0 style before it runs (bash example):\n# ensure every script arg comes after --\ndeno install -g jsr:@std/http/file-server -- 8000","typeGuard":null,"tryCatchPattern":"Wrap global installs; on the 'missing a prefix / Deno 3.0 requires --' message, parse the suggested command from stderr and re-execute it verbatim.","preventionTips":["Always write `--` before script arguments in `deno install -g` (Deno 3.x syntax)","Sweep scripts/Dockerfiles/docs for `deno install -g <mod> <arg>` when upgrading to 3.x","Give every additional module an explicit jsr:/npm: prefix"],"tags":["install","global","migration","deno-3","cli-args"],"backgroundTag":"missing-argument-separator","analyzedSha":"a961cdec3b1948844414ebeecc697dcad76df2d1","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}