WebStatus wont compile: The "[email protected]" library could not be resolved by the "cdnjs" provider

2.6k Views Asked by At

I have the eShopOnContainers solution here: https://github.com/dotnet-architecture/eShopOnContainers. I have been actively working on a variation of it for the last few years. I attempted to compile it this morning and the WebStatus project causes this error:

libman.json(0,0): Error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider

I have found this: https://github.com/aspnet/LibraryManager/issues/685 and this: https://issuemode.com/issues/cdnjs/cdnjs/94570425 (updated yesterday)

So far I have tried what is suggested in the articles:

dotnet tool install -g Microsoft.Web.LibraryManager.Cli (installs version 2.1.75) libman cache clean libman restore

Is there anything else I can try? My Libman.json looks like this:

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "libraries": [
    {
      "library": "[email protected]",
      "destination": "wwwroot/lib/jquery/"
    },
    {
      "provider": "unpkg",
      "library": "[email protected]",
      "files": [
        "dist/css/bootstrap.css",
        "dist/css/bootstrap.css.map",
        "dist/css/bootstrap.min.css",
        "dist/css/bootstrap.min.css.map",
        "dist/js/bootstrap.js",
        "dist/js/bootstrap.min.js"
      ],
      "destination": "wwwroot/lib/bootstrap/"
    }
  ]
}
3

There are 3 best solutions below

2
Ivannick de Freijtas On

Try this:

-Right click libman.json

  • Disable Client-Side libraries on build

Build the project

1
Alexandre M On

This happened to me after installing Visual Studio 2022 because Nuget package Microsoft.Web.LibraryManager.Build was not installed. Here's what I did:

  • Right click on libman.json file and select "Disable client-side libraries on build"
  • Right click on the same file again and re-enable the option
  • Nuget will install the required package Microsoft.Web.LibraryManager.Build
  • Build the project

If Nuget fails to install it this way you can manually install it via Nuget Package Manager Console

0
Paul Kunda On

A comment by @Xorcist worked for me. I just uninstall my current installed version [which was old] and installed the latest version.

  1. dotnet tool uninstall --global Microsoft.Web.LibraryManager.Cli [2.1.113]
  2. dotnet tool install --global Microsoft.Web.LibraryManager.Cli --version 2.1.175

Please make reference to the official Nuget Gallery for the latest version