How to Install Node.js Latest Version Using Homebrew on Linux
After installing Node.js version 20 using Homebrew on Linux, the new version is not being used, and the old version of Node.js is still active. This happens because Homebrew installs Node.js version 20 as “keg-only,” meaning it does not automatically symlink this version into the system’s PATH. As a result, users continue to use the previously installed version of Node.js.
Symptoms:
Running node -v shows the old version of Node.js instead of the newly installed version 20.
Running npm -v might also show the old version.
Confusion and difficulty in switching to the newly installed version.
I started by using Homebrew to install Node.js version 20:
brew install node@20
After installation, I ran the following command to check the version of Node.js:
node -v
The output still showed the old version of Node.js instead of the newly installed version 20. This indicated that the new version was not being used.
Read more here: Source link
