Issue 1:
Is there an existing issue for this?

I have searched the existing issues

This issue exists in the latest npm version

I am using the latest npm

Current Behavior

Prerequisites: Clear npm cache first (see Steps To Reproduce below)

Running npx -y git+ssh://git@github.com:prettier/prettier.git throws without any error message.

However, npm exec -y git+ssh://git@github.com:prettier/prettier.git works successfully.

Expected Behavior

Both of the above commands should produce the same output and not throw any errors.

Steps To Reproduce

Run rm -rf ~/.npm/_cacache

Run rm -rf ~/.npm/_npx

Run npx -y git+ssh://git@github.com:prettier/prettier.git in any directory.

Process throws without displaying any error message.

Run npm exec -y git+ssh://git@github.com:prettier/prettier.git.

Command works successfully.

Subsequent reruns of npx -y git+ssh://git@github.com:prettier/prettier.git work now.

Environment

npm: 9.5.0

Node.js: 18.14.2

OS Name: macOS 13.2.1

System Model Name: Macbook Pro

npm config:

; 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.

Issue 2:
Is there an existing issue for this?

I have searched the existing issues

This issue exists in the latest npm version

I am using the latest npm

Current Behavior

When trying to install/run the latest version of the npm CLI via the npx command I get a no output and an exit code of 1.

$ npx npm@npm/cli#latest version
Need to install the following packages:
github:npm/cli#latest
Ok to proceed? (y) y
$ echo $?
1

Worth noting that the above command will work as expected if the referenced package has already been installed/cached (say, by running npm exec npm@npm/cli#latest first). So it seems like the issue may be related to downloading/installing.

Expected Behavior

I expect the package to be downloaded and executed similar to the way it works w/ the npm exec command:

$ 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'
}

Steps To Reproduce

Start w/ an empty "~/.npm/_npx" directory to ensure you don't already have the package installed.

Execute npx npm@npm/cli#latest version

Answer "y" when prompted about proceeding w/ the package installation

Note that no output is displayed the the process exit code is non-zero

Environment

npm: 9.1.1

Node.js: v14.20.0

OS Name: macOS 13.0.1

System Model Name: Macbook Pro M1 Max

npm config:

; "user" config from /Users/bdehamer/.npmrc

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

; "cli" config from command line options

location = "project"

; 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.