victoriaopk.blogg.se

Install nvm mac brew
Install nvm mac brew











install nvm mac brew install nvm mac brew

This guide describes how to install NVM, and how to use it to install and run different versions of Node. NVM allows you to easily install and manage different versions of Node and switch between them on a per-shell basis. NVM is easy to understand and works on any POSIX-compliant shell (for example, sh or bash). Install Node using NVM nvm ls-remote # see the available node versions nvm install node # install latest node version nvm install 10 # install Node.js 10.x version nvm ls # check locally installed versionsĪfter installing, simply switch to the Node version you need to use.The Node Version Manager (NVM) is an open source version manager for Node.js (Node).

install nvm mac brew

source ~/.zshrc # reload config file echo $NVM_DIR # echo path nvm -version # check nvm versionĤ. # add the nvm path export NVM_DIR="$HOME/.nvm" # load the nvm script every time you open the terminal source $(brew -prefix nvm)/nvm.shĬlose your nano editor and verify the path to the home directory. # open config file nano ~./zshrcĪdd the following to the config file. The shell config file would be ~/.bash_profile if you are using Bash, or ~./zshrc if you are using Zsh, the default shell for MacOS Catalina and later versions. mkdir ~/.nvmĮdit your shell config file to add the path to the NVM home directory. sudo chown -R $(whoami):admin /usr/local/* \ & sudo chmod -R g+rwx /usr/local/*Ĭreate NVM’s working directory. If you run into an error such as ‘ Permission denied apply2files’, you may need to reset permissions for /usr/local as mentioned in this SO answer. Install NVM using Homebrew brew install nvm # ignore other artefacts which may depend on node brew uninstall - ignore-dependencies node # remove all versions of node brew uninstall -force nodeĢ. This is important to make sure all your Node installations are managed through NVM. Remove existing Node installed via Homebrew.However, if you want to use different Node versions for different projects, using Node Version Manager (NVM) to switch between versions would make your life easier. If you are using a Mac, you most probably use Homebrew to manage your Node.js installation.













Install nvm mac brew