How to install LTS version of nodejs via homebrew
You can always look up LTS and stable versions from node releases page and also look at homebrew formulae here.
It shows how u can install stable version vs other versions.
For example right now, brew install node@10
will install LTS version 10.16.
You can use
brew install node@4
, brew install node@6
, or brew install node@8
command to install LTS version of Node via Homebrew.
If another version of Node is already installed, you should uninstall it first to avoid conflicts.
Also note that LTS versions of node (e.g. node@10) are keg-only and must either be linked with --force (brew link --force node@10
) or you need to add the binary to your path by running:
echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bashrc