angular - 使用 Visual Studio 在 Mac 上创建一个新的 Angular 项目

标签 angular macos visual-studio-community

我目前正在通过 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::*

enter image description here

现在创建任何 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/

相关文章:

javascript - Angular:如何进行信用卡输入?

从模块中导出的 Angular 组件在另一个模块中不可用

angular - mergeMap 中与 @ngrx 的并行操作?

swift - 无法处理全屏 NSWindow 中的按键事件

mysql - Visual Studio for Mac 的数据库设置

javascript - 函数问题, Angular typescript ,匹配 2 个数组中的 id 值以获取其中之一的索引

macos - 如何将音频波形图像从 ffmpeg 传输到图像显示命令/应用程序中?

ios - 通过 Mac 应用程序向 iPad 应用程序发送通知

c# - Visual Studio 社区代理