devcontainers-contrib / features

🐳 Extra add-in features for Devcontainers and GitHub Codespaces
MIT License
214 stars 111 forks source link

[Bug]: Angular CLI is installed before Node #558

Closed grubeninspekteur closed 6 months ago

grubeninspekteur commented 6 months ago

Feature id and version

ghcr.io/devcontainers-contrib/features/angular-cli:2

Devcontainer base Image

mcr.microsoft.com/devcontainers/java:1-21-bullseye

What happened?

Issue #211 resurfaced since the installsAfter dependency on node is no longer specified in https://github.com/devcontainers-contrib/features/blob/main/src/angular-cli/devcontainer-feature.json as it was in the commit that fixed the linked issue. I had the exact same thing happening with


"features": {
    "ghcr.io/devcontainers/features/node:1": {
        "nodeGypDependencies": true,
        "version": "18",
        "nvmVersion": "latest"
    },
    "ghcr.io/devcontainers-contrib/features/angular-cli:2": {
        "version": "17.0.6"
    }
}

While there is an "installsAfter" dependency in npm-package, it does not seem to be transitive.

Relevant log output

===
Angular feature:
===
cd /tmp/tmp_ddivld1 && chmod +x -R . && _REMOTE_USER="vscode" _REMOTE_USER_HOME="/home/vscode" PACKAGE="@angular/cli" VERSION="17.0.6" NANOLAYER_VERBOSE="" NANOLAYER_FORCE_CLI_INSTALLATION="" NANOLAYER_PROPAGATE_CLI_LOCATION="1" NANOLAYER_CLI_LOCATION="/tmp/nanolayer-aRWKm4N3Oo/nanolayer" bash -i +H ./install.sh
Installing node and npm...
Yarn already installed.
NVM_VERSION=0.39.7
NVM already installed.
Downloading and installing node v20.10.0...

===
Node feature:
===

NVM_VERSION=0.39.7
NVM already installed.
Downloading and installing node v18.19.0...
Downloading https://nodejs.org/dist/v18.19.0/node-v18.19.0-linux-x64.tar.xz...
# 1.7%##### 7.0%######## 12.3%############ 17.5%################ 22.8%#################### 28.0%####################### 33.2%########################### 38.5%############################### 43.7%################################### 48.9%###################################### 53.9%########################################## 59.2%############################################## 64.5%################################################## 69.7%##################################################### 74.9%######################################################### 80.2%############################################################# 85.4%################################################################# 90.6%##################################################################### 95.9%######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v18.19.0 (npm v10.2.3)
default -> 18 (-> v18.19.0 *)
danielbraun89 commented 6 months ago

Thanks @grubeninspekteur for reporting this! I have mistakenly believed that the installAfter is transitive, and while ghcr.io/devcontainers-contrib/features/npm-package feature has ghcr.io/devcontainers/features/node in its installAfter , It does not carry on to the base feature. I have updated all affected features to include the node feature explicitly