I think the problem here is that unless the user does do sudo npm the packages do not get installed due to the location that npm is trying to install those packages i.e in /usr/lib/node_modules.
Is there a way to update the node modules without sudo’ing?
What problem?
The problem in the linked thread is someone messing up their system by using sudo.
It has no place in your npm/pip/etc package management.
For more information on how to handle npm properly, see this: