Skip to content

Commit

Permalink
✨ custom to install the latest version of node
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Feb 25, 2024
1 parent f72fff8 commit 1d618d2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .setup/options/packages/npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ if [ ! -s "$HOME/.nvm/nvm.sh" ]; then
# shellcheck disable=SC1090
source ~/.profile

nvm install node
nvm use node
nvm alias default node
# get and convert the number of the latest version of node
NODE_VERSION=$(nvm ls-remote | grep LTS | tail -n 1 | awk '{print $1}')
NODE_VERSION=$(echo "$NODE_VERSION" | cut -d. -f1)
echo "Installing node version $NODE_VERSION..."

nvm install "$NODE_VERSION"
nvm use "$NODE_VERSION"
nvm alias default "$NODE_VERSION"
else
echo "$COMMAND_NAME install ok installed"
fi
Expand Down

0 comments on commit 1d618d2

Please sign in to comment.