Search code examples
node.jsauthenticationnpmazure-devops-rest-api

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 ?


Solution

  • 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