last update: Dec 4, 2020
- macOS >= 10.14 (Mojave); tested with 10.15 (Catalina)
- homebrew properly installed
brew uninstall --force yarn node npm # remove previously installed node, npm, yarn
brew cleanup # clean all broken symlinks and "waste" (not really required as of homebrew 2019)
brew update # always good to have the latest
If you used the instructions provided in this gist, then you need to do some more cleanup:
- in
~/.bashrc
:
# remove all the lines below:
export NPM_PACKAGES....
export NODE_PATH....
# and remove all references to these variables later in the file
-
delete ".npmrc":
rm -f ~/.npmrc
-
delete all existing installed global npm packages (! but make sure to write down if you're using any of them, to reinstall afterwards)
# !!! DESTRUCTIVE COMMAND, PAY ATTENTION !!!
sudo rm -rf /usr/local/npm_packages # !!! MAKE SURE YOU COPY THIS LINE WITH FULL ABSOLUTE PATH COMPLETELY !!!
this section was updated Apr 2020
# install Yarn (will install node as a dependency, but that's OK)
brew install yarn
Install nvm
Always consult the latest README (Install section)
Install nvm version 0.37.2 (current: Dec 4 2020)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
Install node latest lts (fermium
, v14.x, current on Oct 2020)
nvm install lts/fermium
Set nvm to use latest LTS as default for new bash sessions
echo "lts/fermium" > .nvmrc # default to the latest LTS version
nvm alias default lts/fermium
NEVER use sudo
in any of the commands issued with node
, yarn
, or npm
. If you need global packages installed, just follow nvm guidelines, and do yarn global add <package>
or npm install -g <package>
.
...TODO...
see .git-prompt-colors.sh
@AlphaZach I didn't follow all these steps specifically, and I'm using the default zsh in BigSur. I had to create a ~/.zshrc file and add these lines:
Save and exit the file.
After that, I had to run this in a terminal:
Restart your terminal and it should now be available. (restart may not be required, I'm new to mac)