Installing Node.js and NPM on Manjaro Linux
Since Manjaro is based on Arch, we can surely use pacman to install node.js and npm. But true freedom of npm can be easily enjoyed without needing root access all the time. Here is how to do it:
- Install nvm – Node Version Manager
1$ yaourt -S nvm
This will require root access though, even if only for once. If you don’t have root access at all, you can follow official instructions at https://github.com/creationix/nvm#installation. Following steps (2 to 4) don’t require root access. - Load nvm
1$ source /usr/share/nvm/init-nvm.sh
You can also add the above line in your environment file such as .bashrc so you won’t have to do it every time. - Install Node.js and npm
1$ nvm -g install npm
This will automatically install Node.js for you. - Test your setup – open a new terminal and install a package using npm
123$ nvm use stable$ nvm -g install browser-sync$ browser-sync start --server
Congratulations.
If you are trying to install nvm and you don’t have
yaourt
, just do this:1) open “Add/remove software”
2) in the search bar (there is a search button in the top left corner) type “nvm”
3) on the first result, click the “Build” button and click “Apply” on the bottom of the window
4) click apply again and wait for it to finish. After this, you can proceed to next steps from this tutorial.