update nodejs mac

  1. Open the Terminal app.
  2. Enter the following command: brew update.
  3. After the update process is complete, enter the command: brew upgrade node.
  4. This will update Node.js to the latest version available through Homebrew.