NPM Not Found (CentOS) - wollardj/Mandrill GitHub Wiki

When using sudo or su in CentOS, you may get an error stating that one of the commands you entered wasn't found even though that command is normally in your $PATH. In CentOS, the sudoers file is a little more locked down than in other OSes. There might be a better way to remedy this issue, but here's one solution:

# change to root (login when prompted)

# edit the sudoers file

# You're now editing the sudoers file in vim. Search for 'secure_path' by typing

# Change that line from
# Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
# to...
Defaults    secure_path = /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin