<h1 dir="auto">What / Why</h1>

<p dir="auto">I tried to install electron using <code class="notranslate">npm install --save-dev electron</code>, and npm gave me this(and something like <code class="notranslate">rollbackFailedOptional</code> for a moment before).  Cleaning cache doesn't fix the problem.</p>
<p dir="auto">Versions: Ubuntu 19.10,  node v12.13.1(from <code class="notranslate">sudo n stable</code> after updated npm),  npm 6.12.1(from <code class="notranslate">sudo npm install npm@latest -g</code> with npm 5.8.0 and node v10.15.2 from apt)</p>
<h2 dir="auto">When</h2>

<ul dir="auto">
<li>Whenever I install something using npm, but <code class="notranslate">sudo npm install npm@latest -g</code> works normally.</li>
</ul>
<h2 dir="auto">Where</h2>

<ul dir="auto">
<li>npm public registry?</li>
</ul>
<h2 dir="auto">How</h2>
<h3 dir="auto">Current Behavior</h3>

<ul dir="auto">
<li>Here:</li>
</ul>
<blockquote>
<p dir="auto">x7f178735@x7f178735-desktop:~/electron-test$ npm install --save-dev electron<br>
npm ERR! cb() never called!<br>
npm ERR! This is an error with npm itself. Please report this error at:<br>
npm ERR!     <a href="https://npm.community" rel="nofollow">https://npm.community</a><br>
npm ERR! A complete log of this run can be found in:<br>
npm ERR!     /home/x7f178735/.npm/_logs/2019-12-08T10_33_15_026Z-debug.log</p>
</blockquote>
<ul dir="auto">
<li>2019-12-08T10_43_02_816Z-debug.log is here:</li>
</ul>
<blockquote>
<p dir="auto">0 info it worked if it ends with ok<br>
1 verbose cli [<br>
1 verbose cli   '/usr/local/bin/node',<br>
1 verbose cli   '/usr/local/bin/npm',<br>
1 verbose cli   'install',<br>
1 verbose cli   '--save-dev',<br>
1 verbose cli   'electron'<br>
1 verbose cli ]<br>
2 info using npm@6.12.1<br>
3 info using node@v12.13.1<br>
4 verbose npm-session d4ceea4abcc76540<br>
5 silly install loadCurrentTree<br>
6 silly install readLocalPackageData<br>
7 timing npm Completed in 16597ms<br>
8 error cb() never called!<br>
9 error This is an error with npm itself. Please report this error at:<br>
10 error <a href="https://npm.community" rel="nofollow">https://npm.community</a></p>
</blockquote>
<h3 dir="auto">Steps to Reproduce</h3>

<ul dir="auto">
<li>Just simply type <code class="notranslate">npm install --save-dev electron</code> and press ENTER in Terminal.</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>

<ul dir="auto">
<li>I can't describe the normal behavior exactly(install successfully?), but I know it shouldn't be like this.</li>
</ul>
<h2 dir="auto">Who</h2>

<ul dir="auto">
<li>n/a</li>
</ul>
<h2 dir="auto">References</h2>

<ul dir="auto">
<li>Really a lot of similar issues here.</li>
</ul>
<p dir="auto">PS: Please forgive my terribly poor English. I am an amateur programming enthusiast(just googled for this word) in China and a High School student with a not high English mark.</p>
<p dir="auto">PS2: Reporting a bug(?) is sometime even troublesome than programming. I've spent about 1 hour writing this issue.</p>
<h1 dir="auto">Updated</h1>
<p dir="auto">See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1336597235" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/5302" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/5302/hovercard" href="https://github.com/npm/cli/issues/5302">#5302</a>.</p>
<p dir="auto">The discussion went in unhelpful directions. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1336597235" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/5302" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/5302/hovercard" href="https://github.com/npm/cli/issues/5302">#5302</a> replaces this issue.</p>
<h1 dir="auto">Original</h1>
<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">If I run the config command to set my name, I get a confusing and misleading warning:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="mv ~/.npmrc ~/&quot;.npmrc.$(date '+%F_%H.%M.%S').bak&quot;

npm config set init.author.name &quot;AJ ONeal&quot;"><pre class="notranslate">mv <span class="pl-k">~</span>/.npmrc <span class="pl-k">~</span>/<span class="pl-s"><span class="pl-pds">"</span>.npmrc.<span class="pl-s"><span class="pl-pds">$(</span>date <span class="pl-s"><span class="pl-pds">'</span>+%F_%H.%M.%S<span class="pl-pds">'</span></span><span class="pl-pds">)</span></span>.bak<span class="pl-pds">"</span></span>

npm config <span class="pl-c1">set</span> init.author.name <span class="pl-s"><span class="pl-pds">"</span>AJ ONeal<span class="pl-pds">"</span></span></pre></div>
<div class="highlight highlight-text-adblock notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm WARN config init.author.name Use `--init-author-name` instead."><pre class="notranslate">npm WARN config init.author.name Use `--init-author-name` instead.</pre></div>
<p dir="auto">So then if I try again a few different ways:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm config set --init-author-name &quot;AJ ONeal&quot;

npm config --init-author-name &quot;AJ ONeal&quot;"><pre class="notranslate">npm config <span class="pl-c1">set</span> --init-author-name <span class="pl-s"><span class="pl-pds">"</span>AJ ONeal<span class="pl-pds">"</span></span>

npm config --init-author-name <span class="pl-s"><span class="pl-pds">"</span>AJ ONeal<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">I get usage errors:</p>
<div class="highlight highlight-text-adblock notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm ERR! code EUSAGE"><pre class="notranslate">npm ERR! code EUSAGE</pre></div>
<p dir="auto">And if I try the simplest form I can think of:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm --init-author-name &quot;AJ ONeal&quot;"><pre class="notranslate">npm --init-author-name <span class="pl-s"><span class="pl-pds">"</span>AJ ONeal<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">I get yet a different usage error:</p>
<div class="highlight highlight-text-adblock notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm &lt;command&gt;

Usage:

..."><pre class="notranslate">npm &lt;command&gt;

Usage:

...</pre></div>
<p dir="auto">And I can try putting <code class="notranslate">--init-author-name</code> in <code class="notranslate">.npmrc</code>, but this also doesn't work:</p>
<div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="--init-author-name=&quot;AJ ONeal&quot;
--init-author-email=&quot;coolaj86@gmail.com&quot;"><pre class="notranslate">--<span class="pl-k">init-author-name</span>=<span class="pl-s"><span class="pl-pds">"</span>AJ ONeal<span class="pl-pds">"</span></span>
--<span class="pl-k">init-author-email</span>=<span class="pl-s"><span class="pl-pds">"</span>coolaj86@gmail.com<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">These are all ignored on <code class="notranslate">npm init</code>.</p>
<p dir="auto">Keywords for the sake of SEO and people trying to search for this in the GitHub tool:</p>
<ul dir="auto">
<li>init.author.name</li>
<li>init-author-name</li>
<li>--init-author-name</li>
<li>init.author.email</li>
<li>init-author-email</li>
<li>--init-author-email</li>
<li>init.author.url</li>
<li>init-author-url</li>
<li>--init-author-url</li>
<li>init.license</li>
<li>init-license</li>
<li>--init-license</li>
<li>init.version</li>
<li>init-version</li>
<li>--init-version</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Either the built-in documentation should be updated to give the output the corresponds to the expected input</p>
<p dir="auto">Or the parsing should change to allow the given output as input in some way</p>
<h3 dir="auto">Steps To Reproduce</h3>
<p dir="auto">As shown above.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: 8.11.0</li>
<li>Node.js: v16.16.0</li>
<li>OS Name: macOS</li>
<li>System Model Name:</li>
<li>npm config:</li>
</ul>
<div class="highlight highlight-source-ini notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="; N/A"><pre class="notranslate"><span class="pl-c"><span class="pl-c">;</span> N/A</span></pre></div>