Difference between revisions of "Js/Node/NVM/using"

From Adam Meola - wiki
< Js‎ | Node‎ | NVM
Jump to navigation Jump to search
(Created page with "==Confirm NVM is installed:== * Open your terminal / command promt / power shell / however you're set up. * type: :: <code>nvm --version</code> ** This will check the versio...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Confirm NVM is installed:==
 
==Confirm NVM is installed:==
  
* Open your terminal / command promt / power shell / however you're set up.
+
* Open your terminal / command prompt / power shell / however you're set up.
 
* type:  
 
* type:  
 
:: <code>nvm --version</code>
 
:: <code>nvm --version</code>
Line 12: Line 12:
 
==Install a version of node:==
 
==Install a version of node:==
  
* Open your terminal / command promt / power shell / however you're set up.
+
* Open your terminal / command prompt / power shell / however you're set up.
 
* Type:
 
* Type:
 
** <code>nvm install [versionNumber]</code>
 
** <code>nvm install [versionNumber]</code>
 
** 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 12.18.3</code>
+
*** <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
  
 
==Switching between node versions==
 
==Switching between node versions==
  
* Open your terminal / command promt / power shell / however you're set up.
+
* Open your terminal / command prompt / power shell / however you're set up.
 
* Type:
 
* Type:
 
** <code>nvm use [versionNumber]</code>
 
** <code>nvm use [versionNumber]</code>
Line 35: Line 35:
 
(The version which will be used by default without switching)
 
(The version which will be used by default without switching)
  
* Open your terminal / command promt / power shell / however you're set up.
+
* Open your terminal / command prompt / power shell / however you're set up.
 
* Type:
 
* Type:
 
:: <code>nvm alias default [versionNumber]</code>
 
:: <code>nvm alias default [versionNumber]</code>
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 promt / power shell / however you're set up.
+
* 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>sadfsad</code>
+
:: <code>__</code>

Latest revision as of 04:09, 9 October 2020

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

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

__