I think that's not optimal. Having package being installed "globally" (as in available on your PATH) is nice. You can install `yarn` by doing `npm install --global yarn`.
The trouble is how people setup their node/npm installation. Instead of having global packages setup under the home directory, people use the default which requires root access.
Instead, default installation should be in user-accessible place and running npm with sudo should be exiting without doing anything.