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

chore: support node v22, warn on v18 (#4644) #489

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
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
12 changes: 5 additions & 7 deletions src/steps/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,25 +148,23 @@ def runp(cmd, skip_log=False):
NVMRC_PATH = CLONE_DIR_PATH / NVMRC
if NVMRC_PATH.is_file():
# nvm will output the node and npm versions used
# the warning is currently non-reachable but leaving it in for October 2024
# to warn about node 18 EOL
logger.info('Checking node version specified in .nvmrc')
runp("""
RAW_VERSION=$(nvm version-remote $(cat .nvmrc))
MAJOR_VERSION=$(echo $RAW_VERSION | cut -d. -f 1 | cut -dv -f 2)
if [[ "$MAJOR_VERSION" =~ ^(18|20)$ ]]; then
if [[ "$MAJOR_VERSION" =~ ^(18|20|22)$ ]]; then
echo "Switching to node version $RAW_VERSION specified in .nvmrc"

if [[ "$MAJOR_VERSION" -eq 16 ]]; then
echo "WARNING: Node $RAW_VERSION will reach end-of-life on 9-11-2023, at which point Pages will no longer support it."
echo "Please upgrade to LTS major version 18 or 20, see https://nodejs.org/en/about/releases/ for details."
if [[ "$MAJOR_VERSION" -eq 18 ]]; then
echo "WARNING: Node $RAW_VERSION will reach end-of-life on 2025-04-30, at which point Pages will no longer support it."
echo "Please upgrade to LTS major version 20 or 22, see https://nodejs.org/en/about/releases/ for details."
fi

nvm install $RAW_VERSION
nvm alias default $RAW_VERSION
else
echo "Unsupported node major version '$MAJOR_VERSION' specified in .nvmrc."
echo "Please upgrade to LTS major version 18 or 20, see https://nodejs.org/en/about/releases/ for details."
echo "Please upgrade to LTS major version 20 or 22, see https://nodejs.org/en/about/releases/ for details."
exit 1
fi
""") # noqa: E501
Expand Down
Loading