How to upgrade Node
- Submit a PR that updates node to the new version in https://github.com/transcom/circleci-docker/. Here's an example.
- Look for the hash here: https://hub.docker.com/r/milmove/circleci-docker/tags
- In the transcom/mymove repo, create a PR to update node. Here's an example && this PR
Things to modify:
- Bump the nodejs version in
.tool-versions
and.node_version
(some folks may still be using nodenv to manage node) - Modify the instances of
milmove/circleci-docker:milmove-app-
and replace the hash w/ the one found in step 2. (I used the PR branch name rather than hash so it would pull any changes I made over on thecircleci-docker
PR without having to update the hash each time I made a change) - update
check-node-version
andprereqs
- Do a find and replace to update references of the prior node version with the new node version
- Run
make clean build
and verify that the desired version of Node is being used - Get reviews for the 2 PRs to check your work.
- Merge the PR from step 1
- Find the new image hash from the Docker hub
- Update the transcom/mymove PR to use the hash from step 7
- Test again to make sure everything works as expected.
- Announce in #prac-engineering that you will be updating node and any instructions An example slack message
- Merge the PR in transcom/mymove
Troubleshooting
If you're getting a wrong version of node error try the following steps:
- run
brew install nvm
- run
mkdir ~/.nvm
to create nvm working directory - add nvm to shell profile by running:
export NVM_DIR="$HOME/.nvm"
[ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" # This loads nvm
[ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion - run
nvm install 18.20.4
with the version of nodejs you want to install - run
nvm use 18.20.4
with the version of nodejs you want to use
If you're still encountering errors you can use nvm to uninstall the incorrect versions nvm uninstall 18.20.2