How to update node

Updating out of date node versions easily

first page!

  1. Open your console and check your Node.js version.

    $ node -v
    v x.x.x```
    
  2. Install n package using npm if you do not have it installed yet.

    $ sudo npm install -g n```
    
  3. Then, you can update your Node.js to the version you want.

    (Use this command to install the stable node release.)
    $ sudo n stable(Use this command to install/update the latest node release.)
    $ sudo n latest(Use this command to install/update the latest LTS node release.)
    $ sudo n lts```
    
  4. That’s it! You can verify that the update is successful by checking your Node.js version again.

    $ node -v
    v x.x.x```