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