I'm trying to install Node.js on an Nginx+Passenger+Ruby server running the following steps as user 'deploy':

wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
tar zxvf node-v0.10.26.tar.gz
cd node-v0.10.26
sudo ./configure && make && make install

Everything goes fine until it gets to the final make step and ends with this error:

IOError: [Errno 13] Permission denied: '/usr/local/bin/node'
make: *** [install] Error 1

What permissions need to be set on that dir for node to be able to install correctly?


Because with

sudo ./configure && make && make install

only the ./configure phase is run as root, the rest of the commands as an ordinary user.


sudo "./configure && make && make install"

sudo ./configure && sudo make && sudo make install

sudo ./configure
sudo make
sudo make install
  • 3
    Or only run make install as root via sudo since the others do not need to be ran as root at all. – faker Apr 29 '14 at 16:28
  • True that, but still I tend to run all those commands under the same user privileges. root or an ordinary user, not a mix-up. Not even sure why, but that's the way I operate. – Janne Pikkarainen Apr 29 '14 at 16:39
  • 1
    @JannePikkarainen There's usually no reason to do that, you can configure and make a program perfectly fine in a local user directory, but once you want to install, it needs root privileges to write stuff to the (/usr)/bin and /etc directories and such. – Oldskool Apr 30 '14 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.