Skip to content

Instantly share code, notes, and snippets.

@stolsma
Created September 10, 2015 13:33
Show Gist options
  • Select an option

  • Save stolsma/cd5f76b7a32a4c7a02c6 to your computer and use it in GitHub Desktop.

Select an option

Save stolsma/cd5f76b7a32a4c7a02c6 to your computer and use it in GitHub Desktop.

Revisions

  1. stolsma created this gist Sep 10, 2015.
    38 changes: 38 additions & 0 deletions Install Community Node.js.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    Install first for ubuntu:
    ```` bash
    sudo apt-get install build-essential libssl-dev curl git-core
    ````

    Compile the required Node.js version and put in global reach:

    ```` bash
    # install Node.js from Github (replace 4.0.0 with required version)
    git clone https://github.com/nodejs/node.git node4.0.0
    cd node4.0.0
    git checkout v4.0.0
    ./configure --prefix=/usr/local/node4.0.0
    make
    sudo make install
    cd ..
    ````

    Add `nodejs.sh` script to `/etc/profile.d`

    ````
    # set PATH so it includes Node.js bin
    export PATH="/usr/local/node/bin":"${PATH}"
    ````

    Link /usr/local/node to correct version:

    ```` bash
    sudo ln -s /usr/local/node4.0.0 /usr/local/node
    ````

    Adding/changing `/etc/sudoers.d/secure_path`:

    ```` bash
    Defaults secure_path=/usr/local/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
    ````

    (BTW users capable to use `sudo` need to have the `sudo` group in their group list!!)