I am having trouble in installing nodejs, npm and a specific version of angularCli. THe problem is that nodejs appears installed when I use the command
sudo apt install nodejs
but appears not installed when I check for the version.
By using the command which, I am not finding any of nodejs, npm or ng
Like I am showing in the screen.
21 Answer
the Node version at the default Apt PPA is broken. The package is no longer maintained and hasn't been for a while now. It is stuck at version 10, whereas the current official stable release is 17.X.XX. The version is so old that it will not work (trying to use via command line will just give a version deprecation warning), and the NPM configuration installs in a way that anything installed with npm install xxxxx will not be useable.
My advice is to uninstall via apt remove and reinstall via curl or wget, or else add the NodeSource PPAs to sources.list and install from there. See here.
Be sure to uninstall the Ubuntu Repository package first. Otherwise, the system may give the Apt-installed binary priority.