Skip to content

Instantly share code, notes, and snippets.

@asbenjamin
Forked from chranderson/nvmCommands.js
Last active October 31, 2022 08:40
Show Gist options
  • Save asbenjamin/94058134cc4b4ebcbf6d2911de96ec92 to your computer and use it in GitHub Desktop.
Save asbenjamin/94058134cc4b4ebcbf6d2911de96ec92 to your computer and use it in GitHub Desktop.

Revisions

  1. asbenjamin revised this gist Oct 31, 2022. 1 changed file with 15 additions and 8 deletions.
    23 changes: 15 additions & 8 deletions nvmCommands.js
    Original file line number Diff line number Diff line change
    @@ -16,37 +16,44 @@ nvm use 6.9.1

    Compiled all the commands in one place. Hope this helps.

    Install Node
    // Install Node
    nvm install <node_version> // Install a specific Node version
    nvm install node // Install latest Node release (Current)
    nvm install --lts // Install latest LTS release of NodeJS
    nvm install-latest-npm // Install latest NPM release only
    List Available Node Releases

    // List Available Node Releases
    nvm ls-remote
    nvm ls-remote | grep -i "latest"
    nvm ls-remote | grep -i "<node_version>"
    List Installed Nodes

    // List Installed Nodes
    nvm list node // Lists installed Node versions
    nvm list (or) nvm ls // Lists installed Node versions with additional release info
    Switch To Another Node Version

    // Switch To Another Node Version
    nvm use node // Switch to the latest available Node version
    nvm use <node_version_or_alias> // Switch to a specific version
    nvm use --lts // Switch to the latest LTS Node version
    Verifying Node Version

    // Verifying Node Version
    node -v (or) node --version
    npm -v (or) npm --version
    nvm -v (or) nvm --version
    Set Alias

    // Set Alias
    nvm alias default node // Always defaults to the latest available node version on a shell
    nvm alias default <node_version> // Set default node version on a shell
    nvm alias <alias_name> <node_version> // Set user-defined alias to Node versions

    nvm unalias <alias_name> // Deletes the alias named <alias_name>
    Path to Node Executable
    nvm which <installed_node_version> // path to the executable where a specific Node version is installed
    Uninstall Specific Node Version

    // Uninstall Specific Node Version
    nvm uninstall <node_version> // Uninstall a specific Node version
    nvm uninstall --lts // Uninstall the latest LTS release of Node
    nvm uninstall node // Uninstall latest (Current) release of Node
    Uninstall NVM
    To remove, delete, or uninstall nvm, just remove the $NVM_DIR folder (usually ~/.nvm)

    // To remove, delete, or uninstall nvm, just remove the $NVM_DIR folder (usually ~/.nvm)
  2. asbenjamin revised this gist Oct 31, 2022. No changes.
  3. asbenjamin revised this gist Oct 31, 2022. 1 changed file with 39 additions and 1 deletion.
    40 changes: 39 additions & 1 deletion nvmCommands.js
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,42 @@ nvm install 6.9.2
    nvm alias default 6.9.2

    // switch version of node
    nvm use 6.9.1
    nvm use 6.9.1


    Compiled all the commands in one place. Hope this helps.

    Install Node
    nvm install <node_version> // Install a specific Node version
    nvm install node // Install latest Node release (Current)
    nvm install --lts // Install latest LTS release of NodeJS
    nvm install-latest-npm // Install latest NPM release only
    List Available Node Releases
    nvm ls-remote
    nvm ls-remote | grep -i "latest"
    nvm ls-remote | grep -i "<node_version>"
    List Installed Nodes
    nvm list node // Lists installed Node versions
    nvm list (or) nvm ls // Lists installed Node versions with additional release info
    Switch To Another Node Version
    nvm use node // Switch to the latest available Node version
    nvm use <node_version_or_alias> // Switch to a specific version
    nvm use --lts // Switch to the latest LTS Node version
    Verifying Node Version
    node -v (or) node --version
    npm -v (or) npm --version
    nvm -v (or) nvm --version
    Set Alias
    nvm alias default node // Always defaults to the latest available node version on a shell
    nvm alias default <node_version> // Set default node version on a shell
    nvm alias <alias_name> <node_version> // Set user-defined alias to Node versions

    nvm unalias <alias_name> // Deletes the alias named <alias_name>
    Path to Node Executable
    nvm which <installed_node_version> // path to the executable where a specific Node version is installed
    Uninstall Specific Node Version
    nvm uninstall <node_version> // Uninstall a specific Node version
    nvm uninstall --lts // Uninstall the latest LTS release of Node
    nvm uninstall node // Uninstall latest (Current) release of Node
    Uninstall NVM
    To remove, delete, or uninstall nvm, just remove the $NVM_DIR folder (usually ~/.nvm)
  4. @chranderson chranderson created this gist Dec 7, 2016.
    14 changes: 14 additions & 0 deletions nvmCommands.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    // check version
    node -v || node --version

    // list installed versions of node (via nvm)
    nvm ls

    // install specific version of node
    nvm install 6.9.2

    // set default version of node
    nvm alias default 6.9.2

    // switch version of node
    nvm use 6.9.1