Skip to content

Instantly share code, notes, and snippets.

@wmakeev
Last active February 13, 2023 20:56
Show Gist options
  • Save wmakeev/1e20771b28d2399c38018e85c1958d9b to your computer and use it in GitHub Desktop.
Save wmakeev/1e20771b28d2399c38018e85c1958d9b to your computer and use it in GitHub Desktop.
[macOS Brew update Node] #node #brew

Current linked node version,

$ brew search node
==> Formulae
libbitcoin-node  node             node-sass        node@12 ✔        node_exporter    nodeenv
llnode           node-build       node@10          node@14          nodebrew         nodenv

To unlink from current version

$ brew unlink node@12

and uninstall current node version

$ brew uninstall node@12

Install specific version,

$ brew install node@14
node@14 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have node@14 first in your PATH run:
  echo 'export PATH="/usr/local/opt/node@14/bin:$PATH"' >> ~/.zshrc

For compilers to find node@14 you may need to set:
  export LDFLAGS="-L/usr/local/opt/node@14/lib"
  export CPPFLAGS="-I/usr/local/opt/node@14/include"

To link installed version

$ brew link --overwrite node@14

or

$ brew link --force --overwrite node@14

Update NPM

$ npm install --force npm@latest -g

Ensure

$ node -v
v14.15.1

$ npm -v
7.5.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment