[英]Update vsts-npm-auth with new username and password
I have installed the vsts-npm-auth package using following command:我已经使用以下命令安装了vsts-npm-auth package:
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:我运行vsts-npm-auth -config.npmrc命令来设置凭据,但我面临以下错误:
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?
有没有办法发送PUT请求和更新凭证?
I made it work with help of my colleague. 我在同事的帮助下使其工作。
And re-run the below command with auth flag set to false. 并在auth标志设置为false的情况下重新运行以下命令。 It will ask for the creds.
它将要求信誉。
npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth否
If the above solution is not working.如果上述解决方案不起作用。 I am adding a few more steps to the above answer
我在上面的答案中添加了更多步骤
Uninstall vsts-npm-auth package卸载 vsts-npm-auth 包
remove NPM cache移除 NPM 缓存
delete .npmrc file under Users folder //new steps删除用户文件夹下的.npmrc文件//新步骤
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
https://github.com/Microsoft/azure-pipelines-tasks/issues/6733#issuecomment-376604435如链接中所述,删除现有的令牌和详细信息以再次显示登录提示打开 regedit (windowsKey + R + type " regedit") 删除 ->
HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\VSCommon\\14.0\\ClientServices\\TokenStorage\\VisualStudio\\VssApp
Restart your system重启你的系统
And re-run the below command with auth flag set to false.并在 auth 标志设置为 false 的情况下重新运行以下命令。 It will ask for the creds.
它会要求信用。
npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false
vsts-npm-auth -config .npmrc
username=VssSessionToken
username=VssSessionToken
结尾的行; This is an unencrypted authentication token.
; This is an unencrypted authentication token.
; This is an unencrypted authentication token.
password=
password=
email=
email=
的行vsts-npm-auth -config.npmrc
vsts-npm-auth -config.npmrc
Just run "vsts-npm-auth -F -config.npmrc"只需运行“vsts-npm-auth -F -config.npmrc”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.