Installing Node.js on Linux, Ubuntu, Mac or Windows

Video is ready, Click Here to View ×

Describes how to download and install Node.js on Linux, Ubuntu, Mac or Windows.


  1. [admin@vm-con-node]$sudo -su –
    [root@vm-con ~]#mkdir .local
    [root@vm-con]# cd .local/
    [root@vm-con1 ~]#mkdir install
    [root@vm-con ~]#
    [root@vm-con ~]# cd /tmp
    [root@vm-con tmp]#wget
    [root@vm-con tmp]#tar -xzf node-v6.9.0-linux-x64.tar.gz
    [root@vm-con tmp]#cd node-v6.9.0-linux-x64/
    [root@vm-con node-v6.9.0-linux-x64]# cd
    [root@vm-con~]# cd .local/install/
    [root@vm-con install]# mv /tmp/node-v6.9.0-linux-x64 node
    [root@vm-con install]# ls -l
    total 0
    drwxrwxr-x 6 500 pcuser 101 Oct 18 08:29 node
    [root@vm-con install]# cd node/
    [root@vm-con node]# ls -l
    total 136
    drwxrwxr-x 2 500 pcuser 27 Oct 18 08:29 bin
    rw-rw-r- 1 500 pcuser 55148 Oct 18 08:29
    drwxrwxr-x 3 500 pcuser 17 Oct 18 08:29 include
    drwxrwxr-x 3 500 pcuser 25 Oct 18 08:29 lib
    rw-rw-r- 1 500 pcuser 60477 Oct 18 08:29 LICENSE
    rw-rw-r- 1 500 pcuser 17660 Oct 18 08:29
    drwxrwxr-x 5 500 pcuser 42 Oct 18 08:29 share
    [root@vm-con node]#

    Go bash_Profile

    [root@vm-con-supdev01 ~]# vi .bash_profile

    export LOCAL=$HOME/.local/install

    export NODE_PATH=$LOCAL/node/bin

    export PATH=$NODE_PATH:$PATH

    Save and Exit

  2. One question! I just deleted that node folder I managed according to the video, now after 4 months I just deleted that folder and installed the new version on same location, since path is managed so I did nothing to change that and node is working. I want to know is there anything that I need to do further so there will be no problem in the future? As far as I think, there is no need but still if there is, then plz do help!

  3. sudo apt-get update
    sudo apt-get install nodejs
    sudo apt-get install npm

    sudo npm cache clean -f
    sudo npm install -g n
    sudo n stable

    sudo ln -sf /usr/local/n/versions/node/"version"/bin/node /usr/bin/nodejs

  4. For those who couldn't edit .bash_profile (around 9:40), we can edit our .bashrc file. .bash_profile is something OP created and imported .bashrc into it. Here, vi .bashrc, go to end of file, add the same code as OP did. should work fine

  5. some things to mention:
    tar zxf FILENAME
    would not spam your console

    mkdir ~/.local/home
    would create the folder directly in the home directory of the current user

    nano ~/.bashrc
    To edit the file much more easier. F3 to save and F2 to close.
    (If nano is not installed type in sudo apt-get update && sudo apt-get install nano)

    I also did not agree with the reason why you chose the .local path. It is easier for the example but you will not do it that way in a productive server environment.

  6. After editing the .bash_profile(it was completely empty before editing), I try to do the same thing as you did, like closing and reopening the terminal to see the value of "echo $NODE_PATH". But I'm still not getting its value! Why not the process happening in my PC your way? Did I need to do anything else you didn't mentioned in this video?

  7. I'm stuck in paths at 9:40, is there a way I can create or tweak a system file paths file with-out that program Vim? I think that's what it is, it shows nothing on mine just tilda symbols, and I don't know how to use Vim. Thanks for the tut.

Leave a Reply

Your email address will not be published.