Never install node.js directly. Instead, use the [Node Version Manager](https://github.com/nvm-sh/nvm):
```shell
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
```
Now, install node:
```shell
nvm install node # installs the latest version
```
```shell
nvm install --lts # installs the latest LTS version
```
To use node in the shell:
```shell
nvm use node
```
With node installed, to automatically pick a node version:
Create a `.nvmrc` file in the project root with either of:
- `echo node > .nvmrc` for the latest node version
- `echo "lts/*" > .nvmrc` for the latest LTS node version
- `echo 14.17.0 > .nvmrc` to use that specific node version
## npm setup
```shell
nvm install-latest-npm
```