8
votes

Some weeks ago, I followed this tutorial to get started with dotnet core + vue.js.

The steps to install the template were:


Install the SPA (Single Page Application) templates provided by Microsoft:

dotnet new --install Microsoft.AspNetCore.SpaTemplates::*

To get started and create a new Vue project, simply run the following commands on the console:

mkdir new-project
cd new-project
dotnet new vue

It worked perfectly (I repeat: that was some weeks ago).

Now I've repeated the same steps in the same machine and it says "There are no templates that match the name of the input template: vue" =>

Console error

Have the vue.js template been discontinued during the last weeks? Or am I doing something wrong?

4
Running the dotnet new --install... command worked for me. Now I see all the template options including Vue, Aurelia, and Knockout. A moment before the install, they were not there.R. Richards
@R.Richards Thanks, after you told me that it worked for you, I tried different other things to see why it wouldn't work on my machine, and I finally found the cause (see long answer here).Xavier Peña

4 Answers

12
votes

After other comments saying it was working for them, and knowing that it worked for me some weeks ago, I've finally figured out what is going on:

  • On my "Available package sources" (NuGet config) in VS2017, I had the nuget nuget repository from work [work-repo]. I have to connect via VPN to be able to access it (and I wasn't during my tests). I didn't have it connected some weeks ago when the whole process worked perfectly.

  • Now, when I was executing dotnet new --install Microsoft.AspNetCore.SpaTemplates::*, the first lines were informing me that "I am not able to connect o [work-repo]". But then it seemed to continue as if nothing happened, and I ignored it because I didn't see it as something that would have anything to do with "not seeing vue".

  • Once I removed [work-repo] from the sources list, I have been able to see the "vue" template again. I have installed it via dotnet new vue and it works perfectly.


tl;dr: If you have "Nuget package sources" that are not accessible at the moment, the process "Install the SPA templates provided by Microsoft" doesn't work.

2
votes

I had the same issue. In my case, the issue occured after installing Visual Studio 2019. After struggling for a while I found out that the NuGet V2 package source was completely missing.

After going to Tools -> Options -> NuGet Package Manager -> Package Sources, adding https://www.nuget.org/api/v2/, the vue-template appreared after running that command:

dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
0
votes

I similarly found this wasn't working, and the problem was also having a private repository (that needed authentication rather than being completely inaccessible). The simplest solution for me was to list the nuget packages using 'nuget sources', check the name of the private repository, use 'nuget sources Disable -Name [privatereponame]' to temporarily disable the repo, then run 'dotnet new --install Microsoft.AspNetCore.SpaTemplates::*' to install the new templates, and finally 'nuget sources Enable -Name [privatereponame]' to re-enable the private repo that was causing the problem.

0
votes

I had the same problem and it was Telerik source/package causing the issue. Once I removed iy from the "Available package sources" (just like Xavier suggests), the SpaTemplates install completed without error