$ brew install node@10
$ brew install yarn
$ brew unlink node
$ brew link node@10
Warning: node@10 is keg-only and must be linked with --force
:
$ brew link --force node@10
Linking /usr/local/Cellar/node@10/10.14.1...
Error: Could not symlink bin/npm
Target /usr/local/bin/npm
already exists. You may want to remove it:
rm '/usr/local/bin/npm'
To force the link and overwrite all conflicting files:
brew link --overwrite node@10
To list all files that would be deleted:
brew link --overwrite --dry-run node@10
$ ls -l /usr/local/bin/npm
lrwxr-xr-x 1 zunda admin 46 Dec 9 16:47 /usr/local/bin/npm@ -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
わけがわからないよ。うりゃ。
$ brew link --force --overwrite node@10
Linking /usr/local/Cellar/node@10/10.14.1... 3312 symlinks created
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile