<p dir="auto">When I use importMap, my code does not work as executable (<code class="notranslate">deno install</code>).</p>
<p dir="auto"><strong>Tested with Deno v1.30.3</strong>.</p>
<h2 dir="auto">Minimal reproducible example:</h2>
<p dir="auto"><strong>deno.json:</strong></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  ...
  &quot;imports&quot;: {
    &quot;std/&quot;: &quot;https://deno.land/std@0.177.0/&quot;
  },
  ...
}"><pre class="notranslate">{
  <span class="pl-ii">...</span>
  <span class="pl-ent">"imports"</span>: {
    <span class="pl-ent">"std/"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://deno.land/std@0.177.0/<span class="pl-pds">"</span></span>
  },
  <span class="pl-ii">...</span>
}</pre></div>
<p dir="auto"><strong>my-cli.ts</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as log from 'std/log/mod.ts';

log.info('Hello world!')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">log</span> <span class="pl-k">from</span> <span class="pl-s">'std/log/mod.ts'</span><span class="pl-kos">;</span>

<span class="pl-s1">log</span><span class="pl-kos">.</span><span class="pl-en">info</span><span class="pl-kos">(</span><span class="pl-s">'Hello world!'</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>Install &amp; run:</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno install -A ./my-cli.ts

my-cli &lt;--- This throws the error"><pre class="notranslate">deno install -A ./my-cli.ts

my-cli <span class="pl-k">&lt;</span>--- This throws the error</pre></div>
<p dir="auto"><strong>Error output:</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="error: Relative import path &quot;std/log/mod.ts&quot; not prefixed with / or ./ or ../
    at file:///C:/temp/app.ts:1:22"><pre class="notranslate">error: Relative import path <span class="pl-s"><span class="pl-pds">"</span>std/log/mod.ts<span class="pl-pds">"</span></span> not prefixed with / or ./ or ../
    at file:///C:/temp/app.ts:1:22</pre></div>
<p dir="auto">The same problem when I use an import map file (import_map.json). Only if I use absolute paths, it also works with <code class="notranslate">deno install</code>.</p>
<p dir="auto">It seems <code class="notranslate">deno install</code> currently doesn't auto-discover a <code class="notranslate">deno.json</code> or <code class="notranslate">deno.jsonc</code> config file.</p>
<p dir="auto">This is suggested in the help entry for <code class="notranslate">deno install -help</code>.</p>
<div class="highlight highlight-text-adblock notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    -c, --config &lt;FILE&gt;
            The configuration file can be used to configure different aspects of
            deno including TypeScript, linting, and code formatting. **Typically
            the configuration file will be called `deno.json` or `deno.jsonc`
            and automatically detected; in that case this flag is not necessary.**
            See
            https://deno.land/manual@v1.30.0/getting_started/configuration_file"><pre class="notranslate">    -c, --config &lt;FILE&gt;
            The configuration file can be used to configure different aspects of
            deno including TypeScript, linting, and code formatting. <span class="pl-k">**</span>Typically
            the configuration file will be called `deno.json` or `deno.jsonc`
            and automatically detected; in that case this flag is not necessary.<span class="pl-k">**</span>
            See
            https://deno.land/manual@v1.30.0/getting_started/configuration_file</pre></div>
<h2 dir="auto">Steps To Reproduce</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno install -n my-module main.ts"><pre class="notranslate"><code class="notranslate">deno install -n my-module main.ts
</code></pre></div>
<h2 dir="auto">Expected Result</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#!/bin/sh
# generated by deno install
exec deno run --config /Users/foo/.deno/bin/.my-module.deno.json 'file:///Users/foo/my-module/main.ts' &quot;$@&quot;"><pre class="notranslate"><code class="notranslate">#!/bin/sh
# generated by deno install
exec deno run --config /Users/foo/.deno/bin/.my-module.deno.json 'file:///Users/foo/my-module/main.ts' "$@"
</code></pre></div>
<h2 dir="auto">Actual Result</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#!/bin/sh
# generated by deno install
exec deno run --no-config 'file:///Users/foo/my-module/main.ts' &quot;$@&quot;"><pre class="notranslate"><code class="notranslate">#!/bin/sh
# generated by deno install
exec deno run --no-config 'file:///Users/foo/my-module/main.ts' "$@"
</code></pre></div>