Skip to content

Commit

Permalink
Rollback to nvm 0.33.11 and specify default Node version (16) (#732)
Browse files Browse the repository at this point in the history
* Revert "install latest nvm from an up to date source"

This reverts commit de105e1.

* fix: Don't install a system version of Node

`nvm --lts` appears to be installing Node v18.

Node 18 has switched the version of `glibc`, and the version it wants does not seem to be present on the AMI.

Given Node 18 enters a formal LTS in Oct 2022, and builds should be individually managing their node version,
this change removes any system wide install of node.

See: nodejs/node#42659

* Explicitly install latest Node 16 via NVM

* Specify default alias

We were getting errors when attempting to start TeamCity:

N/A: version "N/A -> N/A" is not yet installed.
teamcityagent.service: Control process exited, code=exited status=3
You need to run "nvm install N/A" to install it before using it.

It looks like the default version is not wired up correctly:

nvm ls
v16.15.0
default -> lts/Gallium (-> N/A)

Co-authored-by: Jacob Winch <jacob.winch@guardian.co.uk>
  • Loading branch information
akash1810 and jacobwinch committed May 16, 2022
1 parent 64e57c2 commit 31e20fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion roles/teamcity-agent/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
nvm_version: 0.39.1
nvm_version: 0.33.11
7 changes: 4 additions & 3 deletions roles/teamcity-agent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@
- name: install nvm
shell: |
set -e
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v{{nvm_version}}/install.sh | bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v{{nvm_version}}/install.sh | bash
source /opt/teamcity/.nvm/nvm.sh
nvm install node
nvm install --lts
# Gallium is Node 16
nvm install --lts=Gallium
nvm alias default 16
become: yes
become_user: teamcity
args:
Expand Down

0 comments on commit 31e20fe

Please sign in to comment.