Skip to content

Commit 2951f04

Browse files
authored
Fixed Nvm Source Issue(#1078) (#1114)
* Fixed Nvm Source Issue * Fix: Test Scenario Failure * Updated node feature version * Incorporated Review Comment
1 parent 90824ff commit 2951f04

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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.6.0",
3+
"version": "1.6.1",
44
"name": "Node.js (via nvm), yarn and pnpm",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
66
"description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.",

src/node/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ install_yarn() {
227227
# Yum/DNF want to install nodejs dependencies, we'll use NPM to install yarn
228228
su ${USERNAME} -c "umask 0002 && . '${NVM_DIR}/nvm.sh' && nvm use ${_ver} && npm install --global yarn"
229229
fi
230-
else
230+
else
231231
echo "Yarn already installed."
232232
fi
233233
fi
@@ -309,7 +309,7 @@ curl -so- "https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.
309309
curl -so- "https://raw.githubusercontent.com/nvm-sh/nvm/\${PREV_NVM_VERSION}/install.sh" | bash
310310
NVM_VERSION="\${PREV_NVM_VERSION}"
311311
}
312-
source "${NVM_DIR}/nvm.sh"
312+
[ -s "${NVM_DIR}/nvm.sh" ] && source "${NVM_DIR}/nvm.sh"
313313
if [ "${NODE_VERSION}" != "" ]; then
314314
nvm alias default "${NODE_VERSION}"
315315
fi

0 commit comments

Comments
 (0)