Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update install-gui.sh to use check Node 18 and npm 9 #16424

Merged
merged 6 commits into from
Sep 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions install-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ do_install_npm_locally(){
NODEJS_VERSION="$(node -v | cut -d'.' -f 1 | sed -e 's/^v//')"
NPM_VERSION="$(npm -v | cut -d'.' -f 1)"

if [ "$NODEJS_VERSION" -lt "16" ] || [ "$NPM_VERSION" -lt "7" ]; then
if [ "$NODEJS_VERSION" -lt "16" ]; then
echo "Current NodeJS version($(node -v)) is less than 16. GUI app requires NodeJS>=16."
if [ "$NODEJS_VERSION" -lt "18" ] || [ "$NPM_VERSION" -lt "9" ]; then
if [ "$NODEJS_VERSION" -lt "18" ]; then
echo "Current NodeJS version($(node -v)) is less than 18. GUI app requires NodeJS>=18."
fi
if [ "$NPM_VERSION" -lt "7" ]; then
echo "Current npm version($(npm -v)) is less than 7. GUI app requires npm>=7."
if [ "$NPM_VERSION" -lt "9" ]; then
echo "Current npm version($(npm -v)) is less than 9. GUI app requires npm>=9."
fi

if [ "$(uname)" = "OpenBSD" ] || [ "$(uname)" = "FreeBSD" ]; then
# `n` package does not support OpenBSD/FreeBSD
echo "Please install NodeJS>=16 and/or npm>=7 manually"
echo "Please install NodeJS>=18 and/or npm>=9 manually"
exit 1
fi

Expand All @@ -67,17 +67,17 @@ do_install_npm_locally(){
export N_PREFIX=${SCRIPT_DIR}/.n
PATH="${N_PREFIX}/bin:$(npm bin):${PATH}"
wallentx marked this conversation as resolved.
Show resolved Hide resolved
export PATH
# `n 16` here installs nodejs@16 under $N_PREFIX directory
echo "n 16"
n 16
# `n 18` here installs nodejs@18 under $N_PREFIX directory
echo "n 18"
n 18
echo "Current NodeJS version: $(node -v)"
echo "Current npm version: $(npm -v)"
if [ "$(node -v | cut -d'.' -f 1 | sed -e 's/^v//')" -lt "16" ]; then
echo "Error: Failed to install NodeJS>=16"
if [ "$(node -v | cut -d'.' -f 1 | sed -e 's/^v//')" -lt "18" ]; then
echo "Error: Failed to install NodeJS>=18"
exit 1
fi
if [ "$(npm -v | cut -d'.' -f 1)" -lt "7" ]; then
echo "Error: Failed to install npm>=7"
if [ "$(npm -v | cut -d'.' -f 1)" -lt "9" ]; then
echo "Error: Failed to install npm>=9"
exit 1
fi
cd "${SCRIPT_DIR}"
Expand Down
Loading