0

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?

eComEvo
  • 1,011
  • 3
  • 20
  • 32

1 Answers1

3

Because with

sudo ./configure && make && make install

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

Alternatives:

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

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

sudo ./configure
sudo make
sudo make install
Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
  • 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 08:08