

In Terminal.app enter the following: echo '#!/bin/bash

Let’s create a file to put those commands in. When you have finished entering these details, save and quit by pressing esc then entering :x then pressing enter. You will need to replace “username”, “/path/to/npm”, and “/path/to/node” with the details you gathered in section 1. Username ALL = NOPASSWD: /path/to/npm /path/to/node This will open the /etc/sudoers file for you (probably in vi/vim) press shift+ g to go to the bottom of the file, then press o to insert a newline and start inserting text, enter the following: # Allow me to use npm and node without password

Press enter when you’ve completed entering your password. You will need to enter your password, though you won’t see any typing as you enter it. In Terminal.app, enter the following: sudo visudo Let’s now configure sudo to not require you to use a password for those two commands.
