Skip to content

Node.js

nvm

Install:

sudo pacman -S nvm

Add this to shell startup file (i.e. my custom ~/.config/shell/common/interactive):

export NVM_DIR="$HOME/.nvm"
[ -s "/usr/share/nvm/nvm.sh" ] && \. "/usr/share/nvm/nvm.sh"

Usage

List available remote versions:

nvm ls-remote

Install a version:

nvm install 18
nvm install 18.13.0

The first version installed becomes the default. New shells will start with the default version of node (e.g., nvm alias default).

Use a dedicated node version for current terminal session:

nvm use 18.13.0

Use nvm together with direnv

See direnv.md

Task runners

xrun CLI / @xarc/run-cli

Install:

npm install -g @xarc/run-cli