Running server with npm on https port 443 was fine with sudo
. Until I had to upgrade npm (from v6 to v8). And googling initially didn't help, because everyone is suggesting sudo
.
Found duplicate answer here.
Referring to another site.
A lot of people get stuck here, but the solution is easy. There a few options but this is the one I like. Type the following commands:
sudo apt-get install libcap2-bin
sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``
Now, when you tell a Node application that you want it to run on port 80, it will not complain.