The engine "node" is incompatible with this module. Expected version "^14". Got "15.4.0"
Make sure you're in your user's directory.
[server]$ cd ~
Run the following command to download NVM. Change the version number as needed:
[server]$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
This command installs nvm into a new directory under your user named /.nvm.
This command also adds the following to your .bashrc file:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# This loads nvm bash_completion
Update your .bashrc file to use these new settings.
[server]$ source .bashrc
Then run the following to confirm your local .nvm directory is set.
[server]$ echo $NVM_DIR
If installing NVM as a user on a Shared or Dedicated Server, make sure the script isn't blocked by running the following as your user:
[server]$ setfattr -n user.pax.flags -v "mr" $NVM_DIR/nvm.sh
View the creating and editing a file via SSH article for instructions on how to edit your existing .bash_profile. In this file, add the following line.
source ~/.bashrc
Run the following command to allow your shell to use this new version of nvm:
[server]$ . ~/.bash_profile
To test if you can now use nvm, run the following which should respond with the version you have installed:
[server]$ nvm --version
Install any version of Node.js you wish:
[server]$ nvm install v12.22.7
Set your current version of node to your new version:
[server]$ nvm use v12.22.7
Check which version of Node.js is running by entering the following:
[server]$ node -v
you can also default it to :
[server]$ nvm alias default v12.22.7