GUIDES

Update the version of Node

The most important step is to make sure you run Blot’s test suite against the new version of node to catch any obvious breaking changes.

First, work out the version of node you’d like to use. I do this by visiting the official website and selecting the LTS (long term support) version recommended for most users.

The rest of the guide assumes this version happens to be 12.16.3.

In development

First we need to make two changes to the codebase. Update the node version in .travis.yml:

node_js:
  - "12.16.3"

And edit BLOT_NODE_VERSION in config/environment.sh. Commit and push to a new branch, wait for tests to run on continuous integration server.

To get the new version of node locally, install the version of node you’d like to use:

nvm install 12.16.3

Reinstall the node modules against the new version:

npm ci

Then edit /etc/blot/environment.sh and re-source those environment variables in any open sessions. Use the new version as the default for other projects too:

nvm alias default 12.16.3

In production

edit BLOT_NODE_VERSION in /etc/blot/environment.sh

To get the new version of node locally, install the version of node you’d like to use:

nvm install 12.16.3

Reinstall the node modules against the new version:

npm ci

Restart the production server:

sudo stop blot && sudo start blot

Here’s the production checklist for the PR:

- [ ] Edit BLOT_NODE_VERSION to 12.16.3 in `/etc/blot/environment.sh`
- [ ] nvm install 12.16.3
- [ ] npm ci
- [ ] sudo stop blot && sudo start blot




Sign up Log in

Last updated 4 days ago. Established in the summer of 2013.