我目前正在通过 https://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2017-Launch/WEB-103
设置 Spa 应用Mac 上的 Visual Studio(macOS Sierra,Visual Studio Community 2017)。
我已经成功安装了 Angular Core,目前正在尝试基于已安装的模板之一创建一个新项目。
当我运行 sudo dotnet new -l
时,我可以看到两个 Angular 模板:
MVC ASP.NET Core 与 Angular angular [C#] Web/MVC/SPA
ASP.NET Core 与 Angular angular [C#] Web/MVC/SPA
当运行 sudo dotnet new angular
时,我不断收到以下错误:
Unable to determine the desired template from the input template name: angular.
The following templates partially match the input. Be more specific with the template name and/or language.
Templates Short Name Language Tags
----------------------------------------------------------------------------
MVC ASP.NET Core with Angular angular [C#] Web/MVC/SPA
ASP.NET Core with Angular angular [C#] Web/MVC/SPA
Examples:
dotnet new angular
dotnet new angular
dotnet new --help
命令中是否缺少某些内容? Visual Studio/dotnet 是否配置不正确?
最佳答案
要安装单页应用程序 (SPA) 模板,请运行以下命令:
dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
现在创建任何 SPA ...
dotnet new angular -o ngApp
cd .\ngApp\
npm install
dotnet restore
dotnet run
关于angular - 使用 Visual Studio 在 Mac 上创建一个新的 Angular 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44831899/