title: npm ERR! Unable to authenticate, need: Basic realm="Artifactory Realm"
body: <p>I tried to run the command:</p>
  <pre><code>npm install -g @angular/cli@9.1.0
  </code></pre>
  <p>but I have got the following error:</p>
  <pre><code>npm ERR! code E401
  npm ERR! Unable to authenticate, need: Basic realm=&quot;Artifactory Realm&quot;
  
  npm ERR! A complete log of this run can be found in:
  npm ERR! /Users/xxxx/.npm/_logs/2021-08-10T19_33_12_063Z-debug.log
  </code></pre>
  <p>note: node js and npm worked fine.</p>
  <p>I have followed the instructions in Artifactory to solve this issue using the command:</p>
  <pre><code>npm config set registry https://artifactory.......com/artifactory/api/npm/xxxx/
  </code></pre>
  <p>as I have paste the following into the ~/.npmrc file :</p>
  <pre><code>_auth = fhgf......ghgj==
  email = xxx@xxx.com
  always-auth = true
  </code></pre>
  <p>I have also tried using <code>npm login</code>, but I have got the below err and couldn’t continue:</p>
  <pre><code>npm login
  Username: xxx@xxx.com
  npm WARN Name may not contain non-url-safe chars 
  Username: (xxx@xxx.com)
  Username: (xxx@xxx.com)
  Username: (xxx@xxx.com)
  Username: (xxx@xxx.com)
  </code></pre>
  <p>How can i solve this issue?</p>