How to Update NodeJS to the Latest Version ?

Last Updated On Saturday 9th Apr 2022

Update NodeJS to the Latest Version

New Node.js versions come out often!
Install the latest Node.js version on any Linux, Windows.

Update NodeJS with NPM (Node Package Manager)

	// First, clear the npm cache:
    npm cache clean -f

// Install n, Node’s version manager:
    npm install -g n

//With the n module installed, you can use it to:
    Install the latest stable version: n stable
    Install the latest release: n latest
	

Use the n model witin npm command

	// check the version
node -v
// install n globally
npm install -g n
// install nodejs
sudo n latest
// or specific version
n [version.number]