- Install Node.js
brew install node
Check it worked
- Check the versions
node --version && npm --version
Undo it
- Uninstall Node.js
brew uninstall node
- Install nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bashThe version in Ubuntu's own apt is usually old, so nvm is the better route.
- Load nvm into this terminal
source ~/.bashrc - Install the latest LTS version
nvm install --lts
Check it worked
- Check the versions
node --version && npm --version
Undo it
- Uninstall Node.js
nvm uninstall --lts
- Install Node.js LTS
winget install OpenJS.NodeJS.LTSClose and reopen PowerShell afterwards.
Check it worked
- Check the versions
node --version; npm --version
Undo it
- Uninstall Node.js
winget uninstall OpenJS.NodeJS.LTS