<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"><code class="notranslate">ethereumjs-abi</code> is set as <code class="notranslate">git+https://</code> dependency but it is resolver as <code class="notranslate">git+ssh://</code>. This makes, for example, Github Actions fail</p>
<p dir="auto">package.json in npm registry:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/36084092/157743765-26986112-ffa1-4c30-9925-a811d0daf1ca.png"><img width="771" alt="Screen Shot 2022-03-10 at 16 52 36" src="https://user-images.githubusercontent.com/36084092/157743765-26986112-ffa1-4c30-9925-a811d0daf1ca.png" style="max-width: 100%;"></a></p>
<blockquote>
<p dir="auto">Source: <a href="https://unpkg.com/browse/eth-sig-util@1.4.2/package.json" rel="nofollow">https://unpkg.com/browse/eth-sig-util@1.4.2/package.json</a></p>
</blockquote>
<p dir="auto">My package-lock after installing</p>
<p dir="auto"><a href="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#L1261</a></p>
<p dir="auto"><a href="https://github.com/rsksmart/rLogin-providers/blob/624e76413a3e84e256b254f5b7bfb8f3126f8f6d/packages/rlogin-dcent-provider/package-lock.json#L1294">https://github.com/rsksmart/rLogin-providers/blob/624e76413a3e84e256b254f5b7bfb8f3126f8f6d/packages/rlogin-dcent-provider/package-lock.json#L1294</a></p>
<p dir="auto">An isolation of the problem, take a look at <em>steps to reproduce</em></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/36084092/157743959-bfe56092-0c03-4c12-a254-974b059c352b.png"><img src="https://user-images.githubusercontent.com/36084092/157743959-bfe56092-0c03-4c12-a254-974b059c352b.png" alt="Screen Shot 2022-03-10 at 16 53 16" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/36084092/157744025-25174a9e-e9e1-4461-abb3-6e3d59fac291.png"><img src="https://user-images.githubusercontent.com/36084092/157744025-25174a9e-e9e1-4461-abb3-6e3d59fac291.png" alt="Screen Shot 2022-03-10 at 16 53 42" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Packages using <code class="notranslate">git+https</code> must use HTTPS to resolve</p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>Create a new folder</li>
<li>Do <code class="notranslate">npm init</code></li>
<li>Do <code class="notranslate">npm i eth-sig-util@1.4.2</code></li>
<li>Check package-lock</li>
</ol>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: 8.5.4</li>
<li>Node.js: 16.14.0</li>
<li>OS Name: Mac OS</li>
<li>System Model Name: Macbook Pro</li>
<li>npm config: (nothing changed from default config)</li>
</ul>
<div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<p dir="auto">This also happens in Github Actions environment. See <a href="https://github.com/rsksmart/rLogin-essentials/runs/5498619013?check_suite_focus=true">https://github.com/rsksmart/rLogin-essentials/runs/5498619013?check_suite_focus=true</a></p>
<h2 dir="auto">Expected Behavior</h2>

<p dir="auto"><code class="notranslate">npx --package=@bazel/ibazel ibazel --help</code> should work like normal.</p>
<h2 dir="auto">Current Behavior</h2>

<p dir="auto">The command fails with <code class="notranslate">Cannot read property 'replace' of undefined</code></p>
<h2 dir="auto">Steps to Reproduce</h2>

<ol dir="auto">
<li>There <em>might</em> 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.</li>
<li>Run <code class="notranslate">npx --package=@bazel/ibazel ibazel --help</code>.</li>
</ol>
<h2 dir="auto">Supporting Materials</h2>


<details><summary>npm-debug.log</summary><p dir="auto">

</p><div class="highlight highlight-text-adblock notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="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 (&lt;anonymous&gt;)
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 &quot;/usr/local/bin/node&quot; &quot;/usr/local/lib/node_modules/npm/bin/npm-cli.js&quot; &quot;exec&quot; &quot;--package=@bazel/ibazel&quot; &quot;--&quot; &quot;ibazel&quot; &quot;--help&quot;
36 verbose node v16.3.0
37 verbose npm  v7.15.1
38 error Cannot read property 'replace' of undefined
39 verbose exit 1"><pre class="notranslate">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 (&lt;anonymous&gt;)
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</pre></div>
<p dir="auto"></p></details>
<h4 dir="auto">Environments &amp; Engine Versions</h4>
<table role="table">
<thead>
<tr>
<th>Executable</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="notranslate">node --version</code></td>
<td>v16.3.0</td>
</tr>
<tr>
<td><code class="notranslate">npm --version</code></td>
<td>7.15.1</td>
</tr>
</tbody>
</table>
<table role="table">
<thead>
<tr>
<th>OS</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>macOS Catalina</td>
<td>10.15.7</td>
</tr>
</tbody>
</table>

<h2 dir="auto">Other Supporting Details or Comments</h2>


<p dir="auto">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 <code class="notranslate">undefined</code> value is making its way somewhere it shouldn't be. As far as I can tell, the reason this happens is because:</p>
<ol dir="auto">
<li><code class="notranslate">a</code> is assumed to never be <code class="notranslate">undefined</code>: <a href="https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L163">https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L163</a></li>
<li>But <code class="notranslate">a</code> can be undefined if <code class="notranslate">mani._from</code> is <code class="notranslate">undefined</code>: <a href="https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L146">https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L146</a></li>
<li>And <code class="notranslate">mani._from</code> can be <code class="notranslate">undefined</code> if <code class="notranslate">readPackageJson</code> is used: <a href="https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L100">https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L100</a> since <a href="https://github.com/npm/read-package-json-fast/tree/dc4d7fa7a8e50cf697594edd90b43697f1e3e29c#what-this-module-does"><code class="notranslate">readPackageJson</code> doesn't seem to create a <code class="notranslate">_from</code> field</a> like <a href="https://github.com/npm/pacote/tree/745265a90587981353122bb8f6938856ed36545c#manifests"><code class="notranslate">pacote.manifest</code> does</a>: <a href="https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L106-L109">https://github.com/npm/libnpmexec/blob/5dcbb9a28200f13037a0190843337b0159533890/lib/index.js#L106-L109</a></li>
</ol>
<p dir="auto">I.e. It seems like <code class="notranslate">readPackageJson</code> and <code class="notranslate">pacote.manifest</code> have different return values, but they're assumed to be the same.</p>
<p dir="auto">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.</p>
<p dir="auto">More than happy to submit a PR to address this if there's want for it and consensus about how to address the issue.</p>