Maybe you're running an out-of-date version of NodeJS, because that's all your OS offers as a regular package? That was the problem in my case.
TL/DR; the solution: Install the snap version of NodeJS.
Ubuntu 20.04, for instance, currently ships NodeJS v.10.19.0, and I was seeing the exact same error as the original questioner (who didn't specify their OS).
In any case, for me the solution was to first remove the Node package:
$ sudo apt remove nodejs
And, since I already had the Snap environment set up (see https://snapcraft.io if you don't), I installed NodeJS v.16.17.1 using this command:
$ sudo snap install node --classic
If you're using another OS you'll need a different command (e.g. yum
, or maybe rpm
) to remove the old Node package. The snap command is probably the same for users of any recent OS, with the Snap system installed.