I am trying to upgrade nodejs to latest version in my machine. I am getting below error after executing below commands through npm.
npm install -g n
This gave error as below
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@2.1.12: 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
Then I found this question and executed below commands.
npm install --global --production npm-windows-upgrade
npm-windows-upgrade --npm-version latest
I am getting below error in node command prompt
C:\Users\myName\AppData\Roaming\npm\node_modules\npm-windows-upgrade\src\upgrader.j
s:26
  async ensureInternet () {
        ^^^^^^^^^^^^^^
SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\HP2\AppData\Roaming\npm\node_modules\npm-win
dows-upgrade\bin\npm-windows-upgrade.js:8:16)
Could anyone please help on this?
Current version npm 6.9.0
Current Version node v6.10.3
 
     
    