Forrest logo
back to the nvm tool

nvm:tldr:d503c

nvm: Set the default Node.js version.
$ nvm alias default ${node_version}
try on your machine

This command is used with Node Version Manager (NVM) to create an alias for the default version of Node.js that will be used.

Here is a breakdown of the command:

  • nvm: Refers to Node Version Manager, a popular tool used for managing and switching between different versions of Node.js.

  • alias: A command within NVM used to create an alias for a specific version of Node.js.

  • default: The name given to the alias. In this case, it is the alias for the default version of Node.js.

  • ${node_version}: This syntax is used to reference a variable called "node_version", which should contain the desired version number of Node.js. The variable will be replaced with the actual version number when the command is executed.

To use this command, you need to replace ${node_version} with the desired version number of Node.js. For example, if you want to set Node.js version 14.17.3 as the default, you would write the command as follows:

nvm alias default 14.17.3

After executing this command, Node Version Manager will set the specified version as the default. This means that whenever you open a new terminal session or run a new Node.js project, this version will be used by default unless specified otherwise.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nvm tool