To ensure Anular cli works properly, make sure that you have the LTS version of NodeJS installed, NOT the latest version (from https://nodejs.org/en/).
$ sudo apt install nodejs npm
$ sudo apt-get remove nodejs.
$sudo apt-get purge --auto-remove nodejs
NVM https://www.freecodecamp.org/news/how-to-install-node-js-on-ubuntu-and-update-npm-to-the-latest-version/
If you try installing the latest version of node using the apt-package manager, you'll end up wit little old version. This is because when new versions of a software are released, it can take months for the Ubuntu team to test and release in the official Ubuntu store.
To get the latest versions, we can use either nodesource or nvm (node version manager). I like nvm because it allows me use different node versions for different projects. Using NVM:
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash $ nvm --version
$ nvm install 14.16.0 .
$ nvm install 12.18.1.
$ npm --version
$ nvm use v12.18.1.
$ nvm ls.