Microsoft.AspNetCore.SpaTemplates无法安装。

5

我试图按照 这篇博客文章 进行操作,在我安装了适当的SDK和node之后。

运行命令dotnet new --install Microsoft.AspNetCore.SpaTemplates::*时,我遇到了错误:

恢复C:\Users\xxxx.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj的软件包...正在为源'https://ournugetserver/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.App''重试“FindPackagesByIdAsyncCore”。响应状态代码未指示成功:401 (未经授权)。
正在为源'https://ournugetserver/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.AspNetCore.SpaTemplates''重试“FindPackagesByIdAsyncCore”。响应状态代码未指示成功:401 (未经授权)。
正在为源'https://tcypwv01/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.AspNetCore.SpaTemplates''重试“FindPackagesByIdAsyncCore”。响应状态代码未指示成功:401 (未经授权)。
正在为源'https://ournugetserver/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.App''重试“FindPackagesByIdAsyncCore”。响应状态代码未指示成功:401 (未经授权)。C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): 错误:无法从远程源'https://ournugetserver/httpAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.App''检索有关'Microsoft.NETCore.App'的信息。[C:\Users\xxxxx.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj] C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): 错误:
响应状态代码未指示成功:401 (未经授权)。[C:\Users\xxxxx.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj]
似乎与我们内部的NuGet服务器有关。我正在使用VS 2017。是否有可能强制它忽略我们的NuGet服务器或强制它使用正确的服务器?

我成功地使用文章中描述的yeoman方法安装了模板。 - Steve Greene
2个回答

4

谢谢!这个解决了我的问题。 - FirstRedPepper

2
在Visual Studio中使用快捷键Ctrl+Q,然后键入package sources,单击第一个搜索结果。现在您可以在Visual Studio中管理您的包源。如果您在CLI中遇到此错误,请检查项目目录中是否存在NuGet.config文件,该文件用于还原软件包。如果有,请将其指向另一个NuGet源,或完全删除该文件。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接