There are several ways that you can set up Node.js on a Raspberry Pi when running Raspbian/Rapberry Pi OS. Depending on your needs, the version of the RPi that you're using, and how you like to manage installs, you have a lot of options.
Do not do this if you can avoid it, it's super slow. If you insist on doing it and have the time, you can start at https://nodejs.org. But really, don't do this.
If you have tons of time on your hands, don't need Node anytime soon, and insist on building from source for some reason, here's a guide you can try out that covers building Node.js on an ARMv6 Raspberry Pi.
Side note: unless you have a need for the latest and greatest features, I recommend developing using the most recent Long Term Support (LTS) version of Node available, especially for anything you plan to put into production for any length of time.