Next, clear npm cache with the command: npm cache clean -fĤ. Before updating the Node.js release, check which version you are currently using with: node -vĢ. The n feature allows you to interact with different Node.js versions.ġ. If you want to upgrade Node.js from the command line, use the n model within the npm command. Option 2: Update Node.js on Windows and macOS with NPM If such problems occur, you may want to consider updating with NPM, outlined in the section below. Note: Sometimes, the system fails to overwrite the older Node.js release and you may end up with two versions. The Node.js Setup Wizard appears and guides you through the installation. Once the download is complete, run the installer.Ĥ. The system downloads the package and stores it in the specified directory.ģ. After deciding the version, click on the Windows or the macOS Installer, depending on the system you are using. Navigate to the Node.js website and click on the latest stable version or the newest current release (with the latest features).Ģ. Bz doing so, the system should overwrite the older version with the updated one.ġ. One way to update your Node.js is to go to its official download page and install the newest release. Option 1: Update Node.js on Windows and macOS with Installer Install the n module and update Node.js inside the terminal window.Download the latest Node.js release from its official download page and install the new Node.js release.
Updating Node.js on Windows and macOS follows the same principles. Extract and install the package with the command: sudo tar -C /usr/local -strip-components 1 -xJf node-v14.17.0-linux-圆4.tar.xz Update Node.js to Latest Version on Windows and macOS Next, install xz-utils used to extract the binary package: sudo apt-get install xz-utilsĤ. You can either download the package from your browser or find the version number you need and add it to the wget command: wget ģ.