Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update vsts-npm-auth with new username and password

I have installed the vsts-npm-auth package using following command:

npm install -g vsts-npm-auth --registry https://registry.npmjs.com

And I ran vsts-npm-auth -config .npmrc command to set the credential but I am facing below error:

enter image description here

Now I need to update the credential but it always fetches the existing credential. Is there any way to send PUT request and update the credential ?

like image 815
AnandSonake Avatar asked Feb 04 '23 12:02

AnandSonake


2 Answers

I made it work with help of my colleague.

  1. Uninstall vsts-npm-auth package
  2. remove NPM cache
  3. delete .npmrc file under Users folder
  4. And re-run the below command with auth flag set to false. It will ask for the creds.

    npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false

like image 75
AnandSonake Avatar answered Feb 07 '23 01:02

AnandSonake


If the above solution is not working. I am adding a few more steps to the above answer

  1. Uninstall vsts-npm-auth package

  2. remove NPM cache

  3. delete .npmrc file under Users folder //new steps

  4. https://github.com/Microsoft/azure-pipelines-tasks/issues/6733#issuecomment-376604435 As mentioned in the link remove the already existing token and details to show the login prompt again open regedit (windowsKey + R + type "regedit") delete -> HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSCommon\14.0\ClientServices\TokenStorage\VisualStudio\VssApp

  5. Restart your system

  6. And re-run the below command with auth flag set to false. It will ask for the creds.

npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false

  1. vsts-npm-auth -config .npmrc
like image 44
sojin Avatar answered Feb 07 '23 02:02

sojin