NPM registry install fails on non-registry dependencies


I’m trying to install my Ionic App through the registry with it’s dependencies.
I try to achieve this with npm i --loglevel verbose while my ~/.npmrc looks like this:


When watching the command run it seems to go just fine, until we hit other non-registry dependencies, suddenly I’m met with an authorisation error.

Here is a paste of the command:

As you see it fails on @angular/[email protected] in this instance, but this variables between random @angular dependencies or @ionic-native

What I have tried so far…

  1. Changing always-auth to true or false
  2. Running as Super User
  3. Trying different tokens
  4. using _authToken instead of _auth
  5. Google, a lot, but it turns out my problem is very unique.
  6. npm login --registry= with both --auth=TOKEN_OMITTED and --authToken=TOKEN_OMITTED where npm tells me npm WARN invalid config auth-type="TOKEN_OMITTED" and prompts for a username, my username however is an email address which throws this error: npm WARN Name may not contain non-url-safe chars only to infinitely keep prompting for another username.


I don’t know how, or why, but somehow it works now if I specify the full registry in the command likeso:

npm --registry= install

While my ~/.npmrc looks like this:

[email protected]

None of this makes sense to me whatsoever, but I’m glad it works for a change.

If anyone ends up writing a proper answer to this as to why this works, how this works and why the normal way doesn’t, then I will gladly accept it as the answer and reward the bounty.

Answered By – Vanitas

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published