title: Best way to import Javascript packages in .NET core app
body: <p>I'm new to the .NET Core framework and currently setting up a dashboard that uses Razor pages and some JavaScript interactions. For the few example projects I've created none of them came with a package manager from the get go, which imho is needed to keep the application maintainable. Coming from Node.js an Ruby on Rails background my default solution is NPM (or Yarn if you want). </p>
  
  <p>I noticed however that Microsoft excluded Node from their base Docker images for .Net about 2 years ago (see here: <a href="https://github.com/aspnet/Announcements/issues/298" rel="nofollow noreferrer">https://github.com/aspnet/Announcements/issues/298</a>).</p>
  
  <p>This led me to questioning my solution to use NPM and I went looking for alternatives. I found that you can install Javascript libraries by wrapping them in Nuget packages and installing them via Nuget. But I'm hesitant to go this way as I've seen this pattern causing issues in Ruby on Rails. It adds an extra layer of maintenance and often the Ruby Gems where no longer maintained, meaning you're unable to move to the newest versions.</p>
  
  <p>Then we have Libman, which is integrated into Visual Studio (<a href="https://docs.microsoft.com/en-us/aspnet/core/client-side/libman/libman-vs?view=aspnetcore-2.2" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/client-side/libman/libman-vs?view=aspnetcore-2.2</a>) and draws packages from <a href="https://cdnjs.com" rel="nofollow noreferrer">https://cdnjs.com</a>, which I believe contains less packages (but according to Microsoft has everything you need). But their own blog (<a href="https://devblogs.microsoft.com/aspnet/library-manager-client-side-content-manager-for-web-apps/" rel="nofollow noreferrer">https://devblogs.microsoft.com/aspnet/library-manager-client-side-content-manager-for-web-apps/</a>) says:</p>
  
  <blockquote>
    <p>LibMan is not a package management system. If you’re happily using npm/yarn/(or something else), we encourage you to continue doing so. LibMan was not developed as a replacement for these tools. For example, the SPA templates (i.e. Angular and React) we ship for ASP.NET Core depend on npm and WebPack, and we have no plans to change that.</p>
  </blockquote>
  
  <p>Then we're left with Bower, which is no longer an option, from <a href="https://bower.io/" rel="nofollow noreferrer">https://bower.io/</a>:</p>
  
  <blockquote>
    <p>...psst! While Bower is maintained, we recommend using Yarn and Webpack or Parcel for front-end projects read how to migrate!</p>
  </blockquote>
  
  <p>So I wonder, for a monolith app, is NPM or Yarn still the right choice and if so, why did Microsoft decide to exclude Node from their base images?</p>