tldr/pages/common/nvm.md

35 lines
815 B
Markdown
Raw Normal View History

2015-12-25 13:48:10 +00:00
# nvm
> Install, uninstall or switch between Node.js versions.
> Supports version numbers like "12.8" or "v16.13.1", and labels like "stable", "system", etc.
> See also: `asdf`.
> More information: <https://github.com/creationix/nvm>.
2015-12-25 13:48:10 +00:00
- Install a specific version of Node.js:
2015-12-25 13:48:10 +00:00
`nvm install {{node_version}}`
- Use a specific version of Node.js in the current shell:
2015-12-25 13:48:10 +00:00
`nvm use {{node_version}}`
- Set the default Node.js version:
2015-12-25 13:48:10 +00:00
`nvm alias default {{node_version}}`
- List all available Node.js versions and highlight the default one:
2015-12-25 13:48:10 +00:00
`nvm list`
- Uninstall a given Node.js version:
`nvm uninstall {{node_version}}`
- Launch the REPL of a specific version of Node.js:
2015-12-25 13:48:10 +00:00
`nvm run {{node_version}} --version`
- Execute a script in a specific version of Node.js:
2015-12-25 13:48:10 +00:00
`nvm exec {{node_version}} node {{app.js}}`