Node: Fix regression - Installing in ubuntu 18.04 (#319)

Node: Fix regression https://github.com/devcontainers/features/issues/317
This commit is contained in:
Samruddhi Khandale 2022-12-02 09:48:04 -08:00 committed by GitHub
parent 46dfa11ecd
commit 7a47fbff00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 4 deletions

View file

@ -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.",

View file

@ -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

View file

@ -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

View file

@ -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"
}
}
}
}
}