Hacker News new | ask | show | jobs
by tbranyen 3033 days ago
Well think harder. Npm runs scripts from package.json. Most folks wouldn't think twice to run sudo npm start as a replacement for sudo node. I sure wouldn't think npm would start mucking with file permissions.
1 comments

I'm sorry but that people can't figure out where to put `sudo` is not a usecase for using sudo...

Instead of running `sudo npm start`, have `scripts.start` have the value `sudo node index.js` if you want.

But then again, I'm not "most folks", I try to think when I am the root user and don't run third-party code willy-nilly when I am.