Notes to Self

Alex Sokolsky's Notes on Computers and Programming

node

On MacOS brew install node works well enough.

On Linux apt install node installs a version which is hopelessly obsolete.

Therefore the plan is to:

  1. install node version manager n with
    sudo npm install -g n
    
  2. use n to install node. To install node into /usr/local:
    sudo n stable
    

    To install node into a user-specific location:

    mkdir ~/n
    export N_PREFIX=$HOME/n
    export PATH="$N_PREFIX/bin:$PATH"
    # Make these permanent by adding to your ~/.zshrc
    n stable
    

Verify node installation:

node --version