diff --git a/src/node/devcontainer-feature.json b/src/node/devcontainer-feature.json index 3abfb04..216f29b 100644 --- a/src/node/devcontainer-feature.json +++ b/src/node/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "node", - "version": "1.1.3", + "version": "1.1.4", "name": "Node.js (via nvm) and yarn", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/node", "description": "Installs Node.js, nvm, yarn, and needed dependencies.", diff --git a/src/node/install.sh b/src/node/install.sh index 9b027d8..4c02c95 100755 --- a/src/node/install.sh +++ b/src/node/install.sh @@ -83,8 +83,10 @@ export DEBIAN_FRONTEND=noninteractive . /etc/os-release if [[ "bionic" = *"${VERSION_CODENAME}"* ]]; then - echo "(!) Unsupported distribution version '${VERSION_CODENAME}'. Details: https://github.com/nodejs/node/issues/42351#issuecomment-1068424442" - exit 1 + if [[ "${NODE_VERSION}" =~ "18" ]] || [[ "${NODE_VERSION}" = "lts" ]]; then + echo "(!) Unsupported distribution version '${VERSION_CODENAME}' for Node 18. Details: https://github.com/nodejs/node/issues/42351#issuecomment-1068424442" + exit 1 + fi fi # Install dependencies diff --git a/test/node/install_node_16_on_bionic.sh b/test/node/install_node_16_on_bionic.sh new file mode 100755 index 0000000..1b301d3 --- /dev/null +++ b/test/node/install_node_16_on_bionic.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "version" bash -c "node --version | grep 16" +check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10" + +# Report result +reportResults diff --git a/test/node/scenarios.json b/test/node/scenarios.json index 70e1051..6112a6e 100644 --- a/test/node/scenarios.json +++ b/test/node/scenarios.json @@ -34,5 +34,13 @@ "version": "19.1.0" } } + }, + "install_node_16_on_bionic": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-18.04", + "features": { + "node": { + "version": "16" + } + } } -} \ No newline at end of file +}