DEV Community

loading...
Cover image for How to install Node.js in Manjaro Linux

How to install Node.js in Manjaro Linux

Víctor Adrián
Fullstack Developer — Specializing Generalist — UI Engineering ⚫ Elixir, Phoenix, Javascript, Vue.js, Material Design, D3, HTML, CSS ⚫ Gamedev/VR/ComputerArt hobbyist ⚫ Aspiring Zen Buddhist
Originally published at lobotuerto.com on ・1 min read

You can check the latest updated version of this article at lobotuerto's notes - How to install Node.js in Manjaro Linux.


Installation process

Version managers rule in dev environments.

So we will install Node.js through nvm.

Install the nvm package from the AUR:

pacaur -S nvm
Enter fullscreen mode Exit fullscreen mode

Then on your terminal:

echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc
exec $SHELL
Enter fullscreen mode Exit fullscreen mode

To list all available versions for Node.js :

nvm ls-remote
Enter fullscreen mode Exit fullscreen mode

Let’s install latest from the 9 series:

nvm install 9
node -v #v9.8.0
npm -v #5.6.0
Enter fullscreen mode Exit fullscreen mode

Add the Yarn package manager globally:

npm install -g yarn
Enter fullscreen mode Exit fullscreen mode

We need to add Yarn’s binary to our $PATH in ~/.bashrc.

In a terminal:

echo 'export PATH=$PATH:~/.yarn/bin' >> ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

If you are a Vue.js fan —and why shouldn’t you be one? :)— install vue-cli:

yarn global add vue-cli
Enter fullscreen mode Exit fullscreen mode

Links

Discussion (3)

Collapse
alligatore3 profile image
Mattia Zanella

Great article dude!

Just a typo at the beginning: pacman -S nvm
I think that also sudo will be required.

Cheers!

Collapse
salihcodev profile image
Ahmed Salih

pacman & pacaur is totally the same, pacaur is just a helper :)

Collapse
alligatore3 profile image
Mattia Zanella

Wow! didn't know about that. Thanks!