The easiest way to install Node and npm is to download the official installer from the Node website:
There are two versions of Node that you can download: the LTS version and the Current version. You will most likely want to download the LTS version of Node, which is the more stable of the two.
npm comes bundled with Node so you won’t have to install anything else.
If you’re not planning on doing any Node development, then the installation method described above should work fine for you. However, if you are going to do Node development (or if you’re going to use any tools that require a specific version of Node), it’s recommended that you install a Node version manager, which lets you install multiple versions of Node on your computer and easily switch between them. The npm docs also state the following:
We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.npm Documentation
There are different Node version managers available depending on whether you’re on Windows or macOS. Here’s a list of some Node version managers from the npm docs:
You can click on the link for each Node version manager to see installation instructions.
Try installing Node on your computer.