User Tools

Site Tools


tips_and_tricks:node

Tips and Tricks : Node

nvm - if you need specific version of node

Sometimes software does not only require node or npm but a specific version of these programs. I met this case when developing within the masterportal framework, the open source software that e.g. powers https://geoportal-hamburg.de/geo-online/).

So what to do if the versions installed on your machine do not meet the requirements? nvm to the rescue! nvm is the Node Version Manager. You can find it at https://github.com/nvm-sh/nvm

Let's see what node and npm versions are installed on my tiny desktop machine, a Raspberry Pi 4 with 8 GB RAM. node -v; npm -v yields

v14.10.0
6.14.8

At the moment (2020-09-09) that is the leading edge version - when time permits I will document how to install the latest version of node on Raspian (or Ubuntu/Debian).

So what does the install documentation for masterportal say? The latest versions that have been shown to work are Node.js 10.15.3 LTS with NPM 6.4.1. So let us tell nvm that we need node.js 10.15.3 and want the latest NPM version compatible with it:

nvm install 10.15.3 --latest-npm

When the command has terminated the active versions of node and npm are as desired, node -v; npm -v now yields

v10.15.3
6.4.1
tips_and_tricks/node.txt · Last modified: 2020/09/09 22:44 by jupp