I suggest against building with sudo (the extra permissions shouldn't be necessary to build Joplin).
sudo
See:
sudo npm install