Skip to content

Commit 9366ef7

Browse files
Node: Fix failure when version:none (#247)
fix version:none
1 parent f1c981d commit 9366ef7

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/node/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "node",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"name": "Node.js (via nvm) and yarn",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
66
"description": "Installs Node.js, nvm, yarn, and needed dependencies.",

src/node/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ rm -rf /var/lib/apt/lists/*
205205
# Ensure privs are correct for installed node versions. Unfortunately the
206206
# way nvm installs node versions pulls privs from the tar which does not
207207
# have group write set. We need this when the gid/uid is updated.
208+
mkdir -p "${NVM_DIR}/versions"
208209
chmod -R g+rw "${NVM_DIR}/versions"
209210

210211
echo "Done!"

test/node/scenarios.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,14 @@
1616
"version": "latest"
1717
}
1818
}
19+
},
20+
"version_none": {
21+
"image": "mcr.microsoft.com/devcontainers/base",
22+
"remoteUser": "vscode",
23+
"features": {
24+
"node": {
25+
"version": "none"
26+
}
27+
}
1928
}
2029
}

test/node/version_none.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "nvm" bash -c ". /usr/local/share/nvm/nvm.sh && nvm install 10"
10+
11+
# Report result
12+
reportResults

0 commit comments

Comments
 (0)