Running nodejs 8.x on Fedora 26

nvm — the node version manager

Matthias Schmid
2 min readOct 30, 2017

Installing nodejs on Fedora 26 can be done like any package in the repositories via dnf install node and dnf install npm for node’s package manager npm.

Problem

If you install it, you may notice by typing node -v, that you will get the nodejs environment with version 6.x called Boron, the LTS version at October 2017. But the engine of version 6.x does not fully support ECMAScript 2016 e.g. async functions.

Solution

To get the version 8.x or multiple different versions of nodejs running on your Fedora 26 workstation you can use nvm, the node version manager. Install it with the following command (you do not need to be root):

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

Now you need to notify your running bash about the installation:

source ~/.bashrc

At this point you can use nvm and its commands. There is no man page available but the program’s help by typing nvm -help. It will print all possible commands and how to use nvm .

But the most important commands in my opinion are the following:

  1. nvm ls-remote prints all available downloadable versions
  2. nvm current display the current active version in your system
  3. nvm install 8.8.1 installs the nodejs version 8.8.1
  4. nvm install stable installs the latest stable version of nodejs
  5. nvm use 6.11.1 changes the system’s defaulting nodejs version
  6. nvm run 8.8.1 app.js runs app.js with a specific nodejs version
  7. nvm remove 8.8.1 removes the node environment 8.8.1 from your system

For all possible commands use the help functionality mentioned above.

Sources

--

--

Matthias Schmid

from python to php over java mainly scripting webdev, nodejs and es6 web audio loving engineer