Skip to content

Commit

Permalink
Fix nvm command check
Browse files Browse the repository at this point in the history
  • Loading branch information
MStolen committed Jan 17, 2024
1 parent d3525c0 commit 12cb411
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/update_node.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash
# Check for node version manager
if ! command -v nvm &> /dev/null
if ! [ -d "${HOME}/.nvm/.git" ] &> /dev/null
then
echo "nvm not found"
echo "Install node version manager from https://github.com/nvm-sh/nvm"
exit 1
fi
nvm install --lts=iron # Install LTS version 20.x.x of node
source ~/.nvm/nvm.sh
nvm install --lts=iron --latest-npm # Install LTS version 20.x.x of node
nvm alias default lts/iron # set default to be LTS version
nvm install-latest-npm # Update npm
if ! command -v pnpm &> /dev/null # check if pnpm is installed
then
# install pnpm
npm install -g pnpm
else
# update pnpm
pnpm add -g pnpm
fi
fi

0 comments on commit 12cb411

Please sign in to comment.