error Unable to authenticate, need: BASIC realm=“Sonatype Nexus Repository Manager“

Today, when I was working on the Vue project to switch private service nexus and NPM login, I encountered the following problem: error unable to authenticate, need: basic realm = “sonatype nexus repository manager”
I searched the Internet, it seems that I may encounter this problem when I log in, register and publish. The reason for the problem is also very clear, Is the authority verification failed. The following is my online solution integration

First, the information input is incorrect. Carefully compare whether the user, password and email you input are correct (do not use the password remembered on the webpage to log in, because it may have been changed.)
the second method: if it’s registration, the user name may have been used
the third method: clear cache: NPM cache clear — force
I’ve tried all the above methods, but it doesn’t solve my problem, The following is my way to solve the problem
the fourth method: add permissions to the private service
(1) the browser logs in to the private service
(2) settings – security – realms – add NPM bearer token realm to the active
the fifth method: the Limited Download address in. Package-lock.json conflicts with the address you use

Check the address used: NRM is to see if it is consistent with the address in package-lock.json. This is my latest problem. When I visit Taobao image and https://registry.npmjs.org/
solution: delete package-lock.json

Read More: