Common commands
# to see which version of the system is already installed, this command can also see which version is currently being used $ NVM ls# list all the version numbers that can be installed $ NVM ls-remote# installation of the specified version $ NVM install [version]$ NVM Inst All v10.2.0# switch to the specified version, the toggle effect is global for NVM use [version]$ NVM uses v10.2.0# view currently used version $ NVM current
Note: <version> refers to any version-like string NVM understands. This includes:-Full or partial version numbers, starting with an optional "V" (0.10, v0.1.2, v1)-Default (built-in) Aliases:node, stable, unstable, iojs, system-custom aliases you define with ' NVM alias foo ' any options that produce C Olorized output should respect the '--no-colors ' option. USAGE:NVM--help Show This message nvm--version Print out T He installed version of NVM NVM install [-S] <version> Download and install a <version>, [-S] From source. Uses. NVMRC if available--reinstall-packages-from=<version> when installing, reinstall packages installed in <node|iojs|node version number>--lts When installing, only select from LTS (l Ong-term support) Versions--lts=<lts name> if installing, only select from versions for A sPecific LTS Line--skip-default-packages When installing, skip the Default-packages file if it exists --LATEST-NPM after installing, attempt to upgrade to the latest working NPM on the given node Version NVM uninstall <version> Uninstall a version nvm uninstall--lts U Ninstall using automatic LTS (long-term support) alias ' lts/* ', if available. NVM Uninstall--lts=<lts name> Uninstall using automatic alias for provided LTS line, if available. NVM use [--silent] <version> Modify PATH to use <version>. Uses. NVMRC if available--lts Uses automatic LTS (long-term support) alias ' lts/* ', if available. --lts=<lts name> Uses Automatic alias for provided LTS line, if available. NVM exec [--silent] <version> [<command>] Run <command> on <version>. Uses. NVMRC IfAvailable--lts Uses automatic LTS (long-term support) alias ' lts/* ', if available. --lts=<lts name> Uses Automatic alias for provided LTS line, if available. NVM run [--silent] <version> [<args>] Run ' node ' on <version> with <args> as arguments. Uses. NVMRC if available--lts Uses automatic LTS (long-term support) alias ' lts/* ', if available. --lts=<lts name> Uses Automatic alias for provided LTS line, if available. NVM current Display currently activated version NVM LS L IST installed versions NVM LS <version> List versions matching a given <version> NV M ls-remote List remote versions available for install--lts When listing, only show LTS (long-term suPport) versions NVM ls-remote <version> List remote versions available for install, matching a GI Ven <version>--lts when listing, only show LTS (long-term support) versions --lts=<lts name> when listing, only show versions for a specific LTS line NVM version <v Ersion> Resolve The given description to a single local version NVM Version-remote <version> Resolve the given description to a single remote version--lts when LIS Ting, only select from LTS (long-term support) versions--lts=<lts name> when listing, onl Y Select from versions to a specific LTS line NVM deactivate Undo effects of ' nvm ' on current Shell NVM alias [<pattern>] Show all aliases beginning with <pattern> NVM alias <nam E> <version> Set an alias named <name> pointing to <version> nvm unalias <name> Deletes the alias named <name> NVM install-latest-npm attempt to upgrade to the latest working ' NPM ' on the current node version NVM reinstall-packages <version> Reinstall Global ' NPM ' packages containe D in <version> to current version nvm unload unload "NVM" from Shell nvm which [cur Rent | <version>] Display path to installed node version. Uses. NVMRC if available nvm cache dir Display path to the cache directory for NVM NVM cache Clear Empty Cache directory for NVMEXAMPLE:NVM install 8.0.0 install a SP Ecific version number NVM use 8.0 use the latest available 8.0.x release NVM run 6.10.3 app.js Run app.js using node 6.10.3 NVM exec 4.8.3 node APP.JS Run ' node App.js ' with the PATH pointing to node 4.8.3 NVM alias default 8.1.0 Set default nod E version on a shell NVM alias default node all default to the latest available node version on a shell note:to Remove, delete, or uninstall Nvm-just remove the ' $NVM _dir ' folder (usually ' ~/.NVM ')