The following tools must be installed
git
curl
make
(see instructions for WSL below)
curl -sL https://git.io/n-install | N_PREFIX=~/.local/opt/n bash -s -- -t
curl -sL https://git.io/n-install | N_PREFIX=~/.local/opt/n bash -s -- -y
curl -sL https://git.io/n-install | N_PREFIX=~/.local/opt/n bash -s -- -y -n
Add the following line (or your shell's equivalent) to your initialization file:
export N_PREFIX="$HOME/.local/opt/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin" # Added by n-install (see http://git.io/n-install-repo)
Remove Windows version of Node from $PATH
:
export PATH="$(echo $PATH | awk -v RS=':' -v ORS='' '/\/c\// {next} {print sep $0; sep = ":"}')"
Now install n without editing .bashrc
:
curl -sL https://git.io/n-install | N_PREFIX=~/.local/opt/n bash -s -- -y -n
Then add the n
binary path at the beginning of the $PATH
in your .bashrc
export N_PREFIX="$HOME/.local/opt/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH="$N_PREFIX/bin:$PATH" # Added by n-install (see http://git.io/n-install-repo)