[英]E401 - Unable to authenticate, your authentication token seems to be invalid
I tested with Azure Packages private NPM server and now want to revert back to using the standard NPM registry but when I do it complains.我使用 Azure Packages 私有 NPM 服务器进行了测试,现在想恢复使用标准 NPM 注册表,但是当我这样做时会抱怨。 I have tried everything I can think of and it is blocking me from doing any work now.
我已经尝试了我能想到的一切,它现在阻止我做任何工作。 I'd really appreciate any help.
我真的很感激任何帮助。
The error错误
If I check the log it is still, somehow, trying to find packages from Azure rather than the npm registry.如果我检查日志,它仍然以某种方式试图从 Azure 而不是 npm 注册表中查找包。
The Azure URL specified below doesnt exist in any.npmrc file or package-lock file I can find!下面指定的 Azure URL 在我能找到的任何.npmrc 文件或包锁定文件中都不存在!
To be clear here I want to use the default NPM registry not Azure.在这里要清楚,我想使用默认的 NPM 注册表而不是 Azure。 eg
例如
32 silly fetch manifest @types/angular@https://pkgs.dev.azure.com/***/***/_packaging/***.Common.UI/npm/registry/@types/angular/-/angular-1.6.45.tgz
Steps I have taken我已采取的步骤
In each case, running npm install
still gives me the same error.在每种情况下,运行
npm install
仍然给我同样的错误。
Please help!请帮忙!
Check your package.json for the node version you should be using and make sure that you are using a compatible version with nvm or something.检查您的 package.json 以获取您应该使用的节点版本,并确保您使用的是与 nvm 或其他东西兼容的版本。 This has been consistently the reason I have seen this error lately on my own machine.
这一直是我最近在自己的机器上看到此错误的原因。
Had similar issue, Deleting the.npmrc and then doing npm login again solved my issue, it was located in the project directory有类似的问题,删除.npmrc然后做npm登录再次解决了我的问题,它位于项目目录
Here I found very useful Microsoft documentation to get rid of this issue在这里我找到了非常有用的微软文档来摆脱这个问题
Please refer to "Unable to authenticate" section https://docs.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows%2Cclassic请参阅“无法验证”部分https://docs.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows%2Cclassic
The credentials in the.npmrc file have an expiration time. .npmrc 文件中的凭据具有过期时间。 You need regenerate these credentials.
您需要重新生成这些凭据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.