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

ethereumjs-abi is set as git+https:// dependency but it is resolver as git+ssh://. This makes, for example, Github Actions fail

package.json in npm registry:

Source: https://unpkg.com/browse/eth-sig-util@1.4.2/package.json

My package-lock after installing

https://github.com/rsksmart/rLogin-providers/blob/624e76413a3e84e256b254f5b7bfb8f3126f8f6d/packages/rlogin-dcent-provider/package-lock.json#L1261

https://github.com/rsksmart/rLogin-providers/blob/624e76413a3e84e256b254f5b7bfb8f3126f8f6d/packages/rlogin-dcent-provider/package-lock.json#L1294

An isolation of the problem, take a look at steps to reproduce

Expected Behavior

Packages using git+https must use HTTPS to resolve

Steps To Reproduce

Create a new folder

Do npm init

Do npm i eth-sig-util@1.4.2

Check package-lock

Environment

npm: 8.5.4

Node.js: 16.14.0

OS Name: Mac OS

System Model Name: Macbook Pro

npm config: (nothing changed from default config)

This also happens in Github Actions environment. See https://github.com/rsksmart/rLogin-essentials/runs/5498619013?check_suite_focus=true

Issue 2:
Expected Behavior

npx --package=@bazel/ibazel ibazel --help should work like normal.

Current Behavior

The command fails with Cannot read property 'replace' of undefined

Steps to Reproduce

There might be an initial step here which is to run said command on node 14.x/npm 6.x. I can't really revert back at the moment to test, but that might be part of the issue.

Run npx --package=@bazel/ibazel ibazel --help.

Supporting Materials

npm-debug.log

0 verbose cli [
0 verbose cli '/usr/local/bin/node',
0 verbose cli '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli 'exec',
0 verbose cli '--package=@bazel/ibazel',
0 verbose cli '--',
0 verbose cli 'ibazel',
0 verbose cli '--help'
0 verbose cli ]
1 info using npm@7.15.1
2 info using node@v16.3.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 0ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/joneshf/programming/joneshf/joneshf.com/.npmrc Completed in 1ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/Users/joneshf/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 6ms
19 timing npm:load:configload Completed in 7ms
20 timing npm:load:setTitle Completed in 16ms
21 timing npm:load:setupLog Completed in 1ms
22 timing npm:load:cleanupLog Completed in 2ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 0ms
25 timing npm:load Completed in 27ms
26 timing config:load:flatten Completed in 2ms
27 timing arborist:ctor Completed in 0ms
28 timing arborist:ctor Completed in 0ms
29 timing arborist:ctor Completed in 0ms
30 timing arborist:ctor Completed in 0ms
31 timing command:exec Completed in 295ms
32 verbose stack TypeError: Cannot read property 'replace' of undefined
32 verbose stack at /usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:163:47
32 verbose stack at Array.map (<anonymous>)
32 verbose stack at exec (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:163:31)
33 verbose cwd /Users/joneshf/programming/joneshf/joneshf.com
34 verbose Darwin 19.6.0
35 verbose argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--package=@bazel/ibazel" "--" "ibazel" "--help"
36 verbose node v16.3.0
37 verbose npm v7.15.1
38 error Cannot read property 'replace' of undefined
39 verbose exit 1

Environments & Engine Versions

Executable
Version

node --version
v16.3.0

npm --version
7.15.1

OS
Version

macOS Catalina
10.15.7

Other Supporting Details or Comments

I fully respect that this might be something very specific to my setup/cache that's causing this, and in that regard the "bug" might not be a bug. However, it still seems like there's a real issue here with the fact that an undefined value is making its way somewhere it shouldn't be. As far as I can tell, the reason this happens is because:

a is assumed to never be undefined: https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L163

But a can be undefined if mani._from is undefined: https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L146

And mani._from can be undefined if readPackageJson is used: https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L100 since readPackageJson doesn't seem to create a _from field like pacote.manifest does: https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L106-L109

I.e. It seems like readPackageJson and pacote.manifest have different return values, but they're assumed to be the same.

As for what caused this, my best guess is that it's something to do with upgrading from node 14.x to node 16.x (and with it, npm 6.x to npm 7.x). This wasn't a problem before that switch, but happened almost immediately after (didn't run this command for a day or so, so can't be entirely sure). I haven't cleared my cache yet in case there's some diagnosis to do, but will shortly since I'd like to not have to work around this.

More than happy to submit a PR to address this if there's want for it and consensus about how to address the issue.