<h3 dir="auto">Is there an existing issue for this?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li>
</ul>
<h3 dir="auto">This issue exists in the latest npm version</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I am using the latest npm</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">Prerequisites: Clear npm cache first (see Steps To Reproduce below)</p>
<p dir="auto">Running <code class="notranslate">npx -y git+ssh://git@github.com:prettier/prettier.git</code> throws without any error message.</p>
<p dir="auto">However, <code class="notranslate">npm exec -y git+ssh://git@github.com:prettier/prettier.git</code> works successfully.</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Both of the above commands should produce the same output and not throw any errors.</p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>Run <code class="notranslate">rm -rf ~/.npm/_cacache</code></li>
<li>Run <code class="notranslate">rm -rf ~/.npm/_npx</code></li>
<li>Run <code class="notranslate">npx -y git+ssh://git@github.com:prettier/prettier.git</code> in any directory.</li>
<li>Process throws without displaying any error message.</li>
<li>Run <code class="notranslate">npm exec -y git+ssh://git@github.com:prettier/prettier.git</code>.</li>
<li>Command works successfully.</li>
<li>Subsequent reruns of <code class="notranslate">npx -y git+ssh://git@github.com:prettier/prettier.git</code> work now.</li>
</ol>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: 9.5.0</li>
<li>Node.js: 18.14.2</li>
<li>OS Name: macOS 13.2.1</li>
<li>System Model Name: Macbook Pro</li>
<li>npm config:</li>
</ul>
<div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="; node bin location = /Users/bob/.nvm/versions/node/v18.14.2/bin/node
; node version = v18.14.2
; npm local prefix = /Volumes/projects
; npm version = 9.5.0
; cwd = /Volumes/projects
; HOME = /Users/bob
; Run `npm config ls -l` to show all defaults."><pre class="notranslate"><span class="pl-c"><span class="pl-c">;</span> node bin location = /Users/bob/.nvm/versions/node/v18.14.2/bin/node</span>
<span class="pl-c"><span class="pl-c">;</span> node version = v18.14.2</span>
<span class="pl-c"><span class="pl-c">;</span> npm local prefix = /Volumes/projects</span>
<span class="pl-c"><span class="pl-c">;</span> npm version = 9.5.0</span>
<span class="pl-c"><span class="pl-c">;</span> cwd = /Volumes/projects</span>
<span class="pl-c"><span class="pl-c">;</span> HOME = /Users/bob</span>
<span class="pl-c"><span class="pl-c">;</span> Run `npm config ls -l` to show all defaults.</span></pre></div>
<h3 dir="auto">Is there an existing issue for this?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li>
</ul>
<h3 dir="auto">This issue exists in the latest npm version</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I am using the latest npm</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">When trying to install/run the latest version of the npm CLI via the <code class="notranslate">npx</code> command I get a no output and an exit code of 1.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ npx npm@npm/cli#latest version    
Need to install the following packages:
  github:npm/cli#latest
Ok to proceed? (y) y
$ echo $?
1"><pre class="notranslate">$ npx npm@npm/cli#latest version    
Need to install the following packages:
  github:npm/cli#latest
Ok to proceed<span class="pl-k">?</span> (y) y
$ <span class="pl-c1">echo</span> <span class="pl-smi">$?</span>
1</pre></div>
<p dir="auto">Worth noting that the above command <strong>will</strong> work as expected if the referenced package has already been installed/cached (say, by running <code class="notranslate">npm exec npm@npm/cli#latest</code> first). So it seems like the issue may be related to downloading/installing.</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">I expect the package to be downloaded and executed similar to the way it works w/ the <code class="notranslate">npm exec</code> command:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ npm exec npm@npm/cli#latest -- version
Need to install the following packages:
  github:npm/cli#latest
Ok to proceed? (y) y
{
  delme: '1.0.0',
  npm: '9.2.0',
  node: '14.20.0',
  v8: '8.4.371.23-node.87',
  uv: '1.42.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '83',
  nghttp2: '1.42.0',
  napi: '8',
  llhttp: '2.1.5',
  openssl: '1.1.1q',
  cldr: '40.0',
  icu: '70.1',
  tz: '2021a3',
  unicode: '14.0'
}"><pre class="notranslate">$ npm <span class="pl-c1">exec</span> npm@npm/cli#latest -- version
Need to install the following packages:
  github:npm/cli#latest
Ok to proceed<span class="pl-k">?</span> (y) y
{
  delme: <span class="pl-s"><span class="pl-pds">'</span>1.0.0<span class="pl-pds">'</span></span>,
  npm: <span class="pl-s"><span class="pl-pds">'</span>9.2.0<span class="pl-pds">'</span></span>,
  node: <span class="pl-s"><span class="pl-pds">'</span>14.20.0<span class="pl-pds">'</span></span>,
  v8: <span class="pl-s"><span class="pl-pds">'</span>8.4.371.23-node.87<span class="pl-pds">'</span></span>,
  uv: <span class="pl-s"><span class="pl-pds">'</span>1.42.0<span class="pl-pds">'</span></span>,
  zlib: <span class="pl-s"><span class="pl-pds">'</span>1.2.11<span class="pl-pds">'</span></span>,
  brotli: <span class="pl-s"><span class="pl-pds">'</span>1.0.9<span class="pl-pds">'</span></span>,
  ares: <span class="pl-s"><span class="pl-pds">'</span>1.18.1<span class="pl-pds">'</span></span>,
  modules: <span class="pl-s"><span class="pl-pds">'</span>83<span class="pl-pds">'</span></span>,
  nghttp2: <span class="pl-s"><span class="pl-pds">'</span>1.42.0<span class="pl-pds">'</span></span>,
  napi: <span class="pl-s"><span class="pl-pds">'</span>8<span class="pl-pds">'</span></span>,
  llhttp: <span class="pl-s"><span class="pl-pds">'</span>2.1.5<span class="pl-pds">'</span></span>,
  openssl: <span class="pl-s"><span class="pl-pds">'</span>1.1.1q<span class="pl-pds">'</span></span>,
  cldr: <span class="pl-s"><span class="pl-pds">'</span>40.0<span class="pl-pds">'</span></span>,
  icu: <span class="pl-s"><span class="pl-pds">'</span>70.1<span class="pl-pds">'</span></span>,
  tz: <span class="pl-s"><span class="pl-pds">'</span>2021a3<span class="pl-pds">'</span></span>,
  unicode: <span class="pl-s"><span class="pl-pds">'</span>14.0<span class="pl-pds">'</span></span>
}</pre></div>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>Start w/ an empty "~/.npm/_npx" directory to ensure you don't already have the package installed.</li>
<li>Execute <code class="notranslate">npx npm@npm/cli#latest version</code></li>
<li>Answer "y" when prompted about proceeding w/ the package installation</li>
<li>Note that no output is displayed the the process exit code is non-zero</li>
</ol>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: 9.1.1</li>
<li>Node.js: v14.20.0</li>
<li>OS Name: macOS 13.0.1</li>
<li>System Model Name: Macbook Pro M1 Max</li>
<li>npm config:</li>
</ul>
<div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="; &quot;user&quot; config from /Users/bdehamer/.npmrc

@github:registry = &quot;https://npm.pkg.github.com/&quot; 
//npm.pkg.github.com/:_authToken = (protected) 
//registry.npmjs.org/:_authToken = (protected) 

; &quot;cli&quot; config from command line options

location = &quot;project&quot; 

; node bin location = /Users/bdehamer/.asdf/installs/nodejs/14.20.0/bin/node
; node version = v14.20.0
; npm local prefix = /private/tmp/delme
; npm version = 9.1.1
; cwd = /private/tmp/delme
; HOME = /Users/bdehamer
; Run `npm config ls -l` to show all defaults."><pre class="notranslate"><span class="pl-c"><span class="pl-c">;</span> "user" config from /Users/bdehamer/.npmrc</span>

@github:<span class="pl-k">registry</span> = <span class="pl-s"><span class="pl-pds">"</span>https://npm.pkg.github.com/<span class="pl-pds">"</span></span> 
//npm.pkg.github.com/:<span class="pl-k">_authToken</span> = (protected) 
//registry.npmjs.org/:<span class="pl-k">_authToken</span> = (protected) 

<span class="pl-c"><span class="pl-c">;</span> "cli" config from command line options</span>

<span class="pl-k">location</span> = <span class="pl-s"><span class="pl-pds">"</span>project<span class="pl-pds">"</span></span> 

<span class="pl-c"><span class="pl-c">;</span> node bin location = /Users/bdehamer/.asdf/installs/nodejs/14.20.0/bin/node</span>
<span class="pl-c"><span class="pl-c">;</span> node version = v14.20.0</span>
<span class="pl-c"><span class="pl-c">;</span> npm local prefix = /private/tmp/delme</span>
<span class="pl-c"><span class="pl-c">;</span> npm version = 9.1.1</span>
<span class="pl-c"><span class="pl-c">;</span> cwd = /private/tmp/delme</span>
<span class="pl-c"><span class="pl-c">;</span> HOME = /Users/bdehamer</span>
<span class="pl-c"><span class="pl-c">;</span> Run `npm config ls -l` to show all defaults.</span></pre></div>