Manage node versions using NVM

Likely caused by the current verson of Node

First thing to try:

rails assets:clobber

Then delete the node_modules folder

rails assets:precompile

Check your node version

node -v

See which node versions are installed on this machine

Assuming you have nvm (node version manager) installed, this command will list your current node versions:

nvm ls

Switch node versions

nvm use 14

(zipmessage tends to work only with node version 14)

Installing nvm (node version manager)

If it's not installed on your machine yet, do this:

CD to the home directory:

Install nvm using homebrew:

This creates the .nvm folder in your home folder briancasel

Then open .bash_profile and put this in it:

Then restart terminal

When you reopen it, you should be able to run nvm and see it's help documentation there.

Set a default version of node specific to each project directory

cd into the project directory and then set the node version you want to make default for this project:

Then run this automatically create a .nvmrc file in this project directory containing the default node version:

All .nvmrc does is make it so that when you run nvm use it will then load that version of node. It doesn't automatically load this version by default when you cd into this project.

To make it automatically load, I updated my alias for this project so that it both cd's to this project folder and then runs nvm use. To do this, I eded .bash_profile (located in home directory-briancasel) and then used this line to create my cdzm shortcut for zipmessage:

Then add .nvmrc to your .gitignore file so that it isn't pushed to github.

Last updated