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
Shell1$ 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
Shell1$ 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
Shell1$ 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
Shell123$ nvm use stable$ nvm -g install browser-sync$ browser-sync start --server