Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

docker-compose build command is failing #756

Closed
kedarbindu opened this issue Jun 22, 2022 · 3 comments · Fixed by #762
Closed

docker-compose build command is failing #756

kedarbindu opened this issue Jun 22, 2022 · 3 comments · Fixed by #762

Comments

@kedarbindu
Copy link

I am trying to clone and build (using docker-compose build) this repository on an Ubuntu 20.04 VM. However, this fails while trying to restore some dependencies using libman. This is the error I get: libman.json: error LIB002: The [email protected] library could not be resolved by the cdnjs provider [/app/src/Web/Web.csproj]

here is a slightly longer log console log:
`Step 7/11 : RUN dotnet publish -c Release -o out
---> Running in ca18bec26643
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
Restored /app/src/Web/Web.csproj (in 3.62 sec).
4 of 5 projects are up-to-date for restore.

Restore operation started
libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider [/app/src/Web/Web.csproj]
libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider [/app/src/Web/Web.csproj]
libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider [/app/src/Web/Web.csproj]
libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider [/app/src/Web/Web.csproj]
libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider [/app/src/Web/Web.csproj]
libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" provider [/app/src/Web/Web.csproj]

One or more libraries failed to restore

The command '/bin/sh -c dotnet publish -c Release -o out' returned a non-zero code: 1
ERROR: Service 'eshopwebmvc' failed to build : Build failed
`

Searching for this error lead me to this issue aspnet/LibraryManager#685 (comment)

I have tried the solution mentioned in this post (from the same issue): aspnet/LibraryManager#685 (comment) but it did not resolve it for me.

Can you please help?

@pheu
Copy link

pheu commented Jun 27, 2022

@kedarbindu I had the same issue. I got it resolved on its own upon building once again.

EDIT: Actually I experienced it with eShopOnContainers.

@looking4ward
Copy link

looking4ward commented Jul 19, 2022

Still same issue here with both eShopOnConatiners and eShopOnWeb
"libman.json : error LIB002: The "[email protected]" library could not be resolved by the "cdnjs" pro
vider [D:\Shop on Microservices example\eShopOnWeb\src\Web\Web.csproj]"

I did update the dotnet CLI too.
dotnet tool install --global Microsoft.Web.LibraryManager.Cli --version 2.1.175

[WORKAROUND]
If you change the libman.json file and change the following references to the libraries that fail, then you can run 'libman restore' and it will download all libraries. ( I looked up the most current release of the libraries at https://cdnjs.com/libraries)
{
"library": "[email protected]",
"destination": "wwwroot/lib/jquery/"
},
{
"library": "[email protected]",
"destination": "wwwroot/lib/jquery-validation-unobtrusive/"
},
{
"library": "[email protected]",
"destination": "wwwroot/lib/jquery-validate/",
"files": [
"jquery.validate.min.js",
"jquery.validate.js"
]
},
{
"library": "[email protected]",
"files": [
"signalr.js",
"signalr.min.js"
],
"destination": "wwwroot/lib/@aspnet/signalr/dist/browser/"
}

After this i could build the project with "dotnet build"

michelcedric added a commit to michelcedric/eShopOnWeb that referenced this issue Jul 21, 2022
@michelcedric
Copy link
Contributor

It seems Cdnjs updated the API.
The LibraryManager pacakage was adapted and of course we need to update to support it.
aspnet/LibraryManager@ed732a8

ardalis pushed a commit that referenced this issue Jul 21, 2022
* fix issue #756

* update all nuget package
greendev3712 added a commit to greendev3712/eShopOnWeb that referenced this issue Feb 26, 2023
* fix issue dotnet-architecture/eShopOnWeb#756

* update all nuget package
rsciriano pushed a commit to rsciriano/eShopOnWeb that referenced this issue Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants