The error usually means that credentials in the .npmrc file are missing or incorrect. I have encountered the error at work; probably, the login token has been invalidated. I have logged in to Sonatype Nexus Repository, regenerated it and copied it; but it still didn't work. Eventually I have discovered the following: the base64 representation of the user:password pair displayed by Nexus was wrong; it omitted the final padding '=' characters. I have manually converted the user:password string to base64 (there's an online utility where this can be done) and copied it to the .npmrc file; then the credentials started working again.