Рет қаралды 28
Steps to Set Up
Install Node.js Versions via Homebrew:
brew install node@16 node@18 node@20 node@22
Add the following line to your .zshrc file
Node.js version (Change version number after "node@xx" to change your node version)
export PATH="/opt/homebrew/opt/node@20/bin:$PATH"
Switch Node.js Versions: To switch Node.js versions, change the version number in the export PATH line in your .zshrc file. For example, to switch to Node.js 18:
export PATH="/opt/homebrew/opt/node@18/bin:$PATH"
Apply Changes: Source your .zshrc file to apply the changes OR simply open a new terminal window.
source ~/.zshrc