Install Node.js in Windows Commands

To install Node.js in windows, open the MSDOS command promt terminal as administrator and execute the following commands in this order. Please read the commands before executing them as you may get the same errors.

  1. View current version: node -v
  2. Clear Cache: npm cache clean -f
  3. [ignore  I sure hope you know what you are doing.]
  4. View current version: node -v
  5. Thats all

OK, hopefully you will not get any errors, but if you do, this is how you troubleshoot.

You might get the following error or something similar:

PS C:\WINDOWS\system32> npm install -g n                                                                                
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS:    !win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\$USER\AppData\Roaming\npm-cache\_logs\2020-04-27T21_30_55_059Z-debug.log

If you get this error, you will have to download the .msi file form the https://nodejs.org/en/ website. After you have downloaded and install it, it will automatically upgrade your node.js version. you can confirm your current version of node with the following command: node -v