Skip to content

NPM Not Found (CentOS)

Joe Wollard edited this page Feb 23, 2014 · 1 revision

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)
su

# edit the sudoers file
visudo

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

# 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

MANUAL INSTALL GUIDE

  1. Users & Groups: Ubuntu | CentOS
  2. Build Tools: Ubuntu | CentOS
  3. NodeJS
  4. Nginx & pm2: Ubuntu | CentOS
  5. Config pm2
  6. Config Nginx: Ubuntu | CentOS
  7. Meteor: Ubuntu | CentOS
  8. MongoDB: Ubuntu | CentOS
  9. Mandrill

MANAGING YOUR SERVER

MANAGING ACCOUNTS

Clone this wiki locally