Difference between revisions of "Js/Node/NVM/using"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 17: | Line 17: | ||
** replace "[versionNumber]" with the version you need | ** replace "[versionNumber]" with the version you need | ||
** at the time of writing this, installing the current LTS version would be: | ** at the time of writing this, installing the current LTS version would be: | ||
− | *** <code>nvm install | + | *** <code>nvm install [versionNumber]</code> |
*** If this is the first version of node that you are installing, it will be assigned as the system default | *** If this is the first version of node that you are installing, it will be assigned as the system default | ||
Line 41: | Line 41: | ||
==Clearing NVM cache (in case default isn't changing)== | ==Clearing NVM cache (in case default isn't changing)== | ||
− | * Open your terminal / command | + | * Open your terminal / command prompt / power shell / however you're set up. |
* run: | * run: | ||
:: <code>nvm clear-cache</code> | :: <code>nvm clear-cache</code> | ||
==Uninstalling a version of node== | ==Uninstalling a version of node== | ||
− | :: <code> | + | :: <code>__</code> |
Latest revision as of 04:09, 9 October 2020
Contents
Confirm NVM is installed:
- Open your terminal / command prompt / power shell / however you're set up.
- type:
nvm --version
- This will check the version of NVM that you have installed
- But I'm using this as a test to see if NVM is installed
- If you get a version number, it's installed
- If not, try restarting the computer and try again
- If it still fails, install again
- This will check the version of NVM that you have installed
Install a version of node:
- Open your terminal / command prompt / power shell / however you're set up.
- Type:
nvm install [versionNumber]
- replace "[versionNumber]" with the version you need
- at the time of writing this, installing the current LTS version would be:
nvm install [versionNumber]
- If this is the first version of node that you are installing, it will be assigned as the system default
Switching between node versions
- Open your terminal / command prompt / power shell / however you're set up.
- Type:
nvm use [versionNumber]
- you should now be on that version of node
- type:
node -v
- if it worked, you'll see the requested version number
- But it is not the system default yet. If you close the terminal and open a new one, type node -v again, you'll see that node v[systemDefault] is in use
Setting Default Node Version
(The version which will be used by default without switching)
- Open your terminal / command prompt / power shell / however you're set up.
- Type:
nvm alias default [versionNumber]
Clearing NVM cache (in case default isn't changing)
- Open your terminal / command prompt / power shell / however you're set up.
- run:
nvm clear-cache
Uninstalling a version of node
__