Latest installed node version not loading on startup - node.js

I've installed the latest node version as you can see in the image on the left-hand terminal. I updated to the latest LTS ages ago, but whenever I start up a new window (right-hand terminal) I'm apparently still using an older version of node. In this screenshot too, I switched to the latest LTS and then opened the right-hand terminal, but it's still saying I'm using 12.20.1.
How can I ensure I have the latest LTS version of node each time I open my terminal?
If it's relevant: I'm using iTerm2, but I get the same response when I use the native Mac terminal or when I use the embedded VSCode terminal.

You should actually update the version by passing it to NVM:
nvm list // will give list
nvm use nodeversion
nvm alias default nodeversion
Now, restart your terminal and check node version. It will be the last updated one. Whenever you change the version try to change the default version to new one.
Updating node to latest:
nvm alias default node
nvm use default

Related

NVM doesn't update Node to the newest version

I'm using NVM (Node version manager) version 1.1.7 on Windows 10 to update Node through the Powershell terminal on VSCode. Today it occured to me that even though after updating and using nvm use 14.15.4 and getting 2 elevation dialogs and NVM telling me that it's now using the newest version, when I do nvm list or node -v or get-command node they're all still telling me that it uses an older version of Node.
After looking around for a bit some solutions said to add "runtimeExecutable": "/Users/*user*/.nvm/versions/node/*version*/bin/node" to the launch.json of VSCode, but that specific path doesn't even exist on my computer.
Check if nvm alias default <version> solves the problem

Node version is not persisting after update with NVM

I updated my node version from 8.x.x to 13.x.x using the cmds below:
nvm install stable
Running node -v immediately after this, shows the updated version. But re-opening the terminal the older version of node persists.
I had to do: nvm use 13 to enable node 13.x.x
What is the ideal way to keep using the latest node version with explicitly using nvm use every time?
nvm alias default 13
This solved the issue and set the node version permanent to 13.x.x

I am suddenly getting an nvm install error message when launching terminal in Mac OS

When I launch terminal I am getting the following message that was not there before:
N/A: version "N/A" is not yet installed.
You need to run "nvm install N/A" to install it before using it.
I am using zsh as my shell and I have nvm configured properly from the install instructions and loading it in my zshrc file.
The message is erroneously telling you to install a version of Node that doesn't exist, because you probably recently updated node and forgot to let nvm know to use it as the new default. To remove the message do the following:
nvm ls and take note of the N/A version that is default and the versions available
nvm alias default v(whatever version you have updated to) e.g. nvm alias default v10.15 in my case.
The next time you load the shell the message should be gone.

NodeJS can't install it properly

I had problem with create-react-app and turned out I gotta update my version of nodeJS. The thing is that I can't do so. when I type node --version I get v11.10.0, however when I type sudo n stable, I get:installed : v10.16.3 (with npm 6.9.0).
However when checking version of node I all time get this 11.10.0. How can I get this last stable version 10.16.3?
EDIT: SOLVED
turned out nvm was installed on laptop and it controled node version
I would suggest you use nvm to manage your node versions. It allows you to download multiple versions and you can assign versions on a per project basis. It also allows you to choose which version you want as default
Install nvm it will allow you to install and use any version you want.
Installation steps on ubuntu 18.04

I installed node.js v5.12.0 but the version showing v0.12.2

I installed Node.js from (https://nodejs.org/dist/latest-v5.x/node-v5.12.0-x64.msi), but the issue is , its showing version v0.12.2 instead of v5.12.0 which is required.
I try to update the node.js 5.2 installer but still showing version v0.12.2.
I have uninstalled Node.js and reinstall node-v5.12.0-x64.msi but still it’s not updated. Due to this am not able to run further commands for Ionic environmental setup.
Open a terminal and type where node
It should point to an old version of node (v0.12.2) still installed on your computer, for example C:\bin\node.
As Node.js is portable, you can have multiple versions on your computer.
If it cannot be uninstalled, simply delete C:\bin\node folder.
Then:
Open Windows System Properties/Advanced system properties
Click on Environment variables and edit PATH variable
Remove inside its value the path of the old version of node (C:\bin\node in our example).
Re-install Node v5.
Close your terminal and open a new one then type where node, it should point to Node.js v5
Most likely, you have an old Node version for x86 platform, and you are installing a newer version for 64 bit. Remove the path to the x86 from the Paths env variable, or move it to after the 64 bit path.
Solution:
List node.js installatios using nvm:
nvm ls
High chance the version you tried to install is also listed
Select the version to use using nvm
nvm use
(Not a direct solution)
You can try to install using nvm
Uninstall nodejs and follow the instruction from https://github.com/coreybutler/nvm-windows

Resources