Unverified Commit 1e35500b authored by Samruddhi Khandale's avatar Samruddhi Khandale Committed by GitHub

Node: Fix bug - version set by Feature is not default (#294)

* Node:Fix bug version set by Feature is not default

* node not supported for ubuntu:bionic
parent f9acb6aa
{ {
"id": "node", "id": "node",
"version": "1.1.1", "version": "1.1.2",
"name": "Node.js (via nvm) and yarn", "name": "Node.js (via nvm) and yarn",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
"description": "Installs Node.js, nvm, yarn, and needed dependencies.", "description": "Installs Node.js, nvm, yarn, and needed dependencies.",
......
...@@ -81,6 +81,12 @@ check_packages() { ...@@ -81,6 +81,12 @@ check_packages() {
# Ensure apt is in non-interactive to avoid prompts # Ensure apt is in non-interactive to avoid prompts
export DEBIAN_FRONTEND=noninteractive 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
fi
# Install dependencies # Install dependencies
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
...@@ -152,7 +158,7 @@ if [ ! -d "${NVM_DIR}" ]; then ...@@ -152,7 +158,7 @@ if [ ! -d "${NVM_DIR}" ]; then
else else
echo "NVM already installed." echo "NVM already installed."
if [ "${NODE_VERSION}" != "" ]; then if [ "${NODE_VERSION}" != "" ]; then
su ${USERNAME} -c "umask 0002 && . $NVM_DIR/nvm.sh && nvm install ${NODE_VERSION}" su ${USERNAME} -c "umask 0002 && . $NVM_DIR/nvm.sh && nvm install ${NODE_VERSION} && nvm alias default ${NODE_VERSION}"
fi fi
fi fi
......
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
check "version_on_path" bash -c "node -v | grep 'v19.1.0'"
# Report result
reportResults
...@@ -25,5 +25,14 @@ ...@@ -25,5 +25,14 @@
"version": "none" "version": "none"
} }
} }
},
"install_node_on_universal_image": {
"image": "mcr.microsoft.com/devcontainers/universal",
"remoteUser": "codespace",
"features": {
"node": {
"version": "19.1.0"
}
}
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment