Skip to content

Commit 1948c1a

Browse files
authored
fix: confirm nvm-windows install succeeded (#9)
1 parent 266bef4 commit 1948c1a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/scripts/install-node.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@ if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then
1010
nvm install lts;
1111
fi
1212

13+
nvm use newest;
1314
echo 'nvm use newest &>/dev/null' >> "$BASH_ENV";
15+
16+
# Confirm that the Node.js version matches what is expected
17+
# using the fully resolved version number from the other
18+
# script, 'resolve-node-js-version.sh'. This is necessary
19+
# because nvm-windows will silently fail if there's an error
20+
# while downloading (and Node.js servers are unstable lately)
21+
# See: https://github.com/coreybutler/nvm-windows/issues/738
22+
if [ "$(node -v)" != "v$(cat ~/.node-js-version)" ]; then
23+
exit 1;
24+
fi
1425
else
1526
# Copyright (c) 2019 CircleCI Public
1627
# (derived from https://github.com/CircleCI-Public/node-orb/blob/master/src/scripts/install-nvm.sh)

0 commit comments

Comments
 (0)