MBP 15in Sonoma 14.2
Appreciate all the extra tips (I do use google, so a lot of the answers seem to repetitive, but that is ok.)
I have done this - please see below
$ brew -v
Homebrew 4.1.25
$ node -v
-ksh: node: not found
$ npm -v
-ksh: npm: not found
$ yarn -v
env: node: No such file or directory
after running brew install node@18
Warning: No available formula with the name “@18”.
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system. (note to self - not to use Sudo when running brew)
This is where I am at now
$ brew install node@18
Warning: node@18 18.19.0 is already installed and up-to-date.
To reinstall 18.19.0, run:
brew reinstall node@18
$ node -v
-ksh: node: not found
$ brew unlink node
Error: No such keg: /usr/local/Cellar/node
$ brew link node@18
Linking /usr/local/Cellar/node@18/18.19.0…
Error: Could not symlink include/node/common.gypi
Target /usr/local/include/node/common.gypi
already exists. You may want to remove it:
rm ‘/usr/local/include/node/common.gypi’
To force the link and overwrite all conflicting files:
brew link --overwrite node@18
To list all files that would be deleted:
brew link --overwrite --dry-run node@18
$ node -v
-ksh: node: not found
$ brew link --overwrite node@18
Linking /usr/local/Cellar/node@18/18.19.0…
Error: Could not symlink include/node/common.gypi
/usr/local/include/node is not writable.
( I used this website to diagnose, download, and get around node/npm
macos - How do I downgrade node or install a specific previous version using homebrew? - Ask Different )
Went to this website next to follow the step-by-step
Still the same error
( node.js - Node already installed, it's just not linked - Stack Overflow )