Skip to content

Instantly share code, notes, and snippets.

@trajakovic
Last active February 16, 2019 16:55
Show Gist options
  • Save trajakovic/ad9f91776dea3b495db0 to your computer and use it in GitHub Desktop.
Save trajakovic/ad9f91776dea3b495db0 to your computer and use it in GitHub Desktop.

Revisions

  1. trajakovic revised this gist Apr 19, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ if [[ ! -e "${NODE_FOLDER}" ]]; then
    update-alternatives --install /usr/bin/npm npm /usr/lib/${NODE_FOLDER}/bin/npm ${NODE_INT_VERSION}

    # update $PATH to make `npm install -g` visible
    cat <<EOF >> /home/${SUDO_USER:-$USER}/.bash_profile
    cat <<EOF >> /home/${SUDO_USER:-$USER}/.bashrc
    # added by https://gist.github.com/trajakovic/ad9f91776dea3b495db0 - NodeJs 'installer'
    export PATH=\$PATH:/usr/lib/${NODE_FOLDER}/bin
  2. trajakovic revised this gist Apr 19, 2016. No changes.
  3. trajakovic revised this gist Apr 19, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@ func_check_for_root() {
    func_check_for_root

    #SETUP PARAMS
    NODE_VERSION="v5.7.0"
    NODE_INT_VERSION="570"
    NODE_VERSION="v5.10.1"
    NODE_INT_VERSION="5101"
    NODE_FILE=node-${NODE_VERSION}-linux-x64.tar.gz
    NODE_FOLDER=node-${NODE_VERSION}-linux-x64
    NODE_URI="https://nodejs.org/dist/${NODE_VERSION}/${NODE_FILE}"
  4. trajakovic revised this gist Feb 26, 2016. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -31,6 +31,13 @@ if [[ ! -e "${NODE_FOLDER}" ]]; then
    # install alternatives
    update-alternatives --install /usr/bin/node node /usr/lib/${NODE_FOLDER}/bin/node ${NODE_INT_VERSION}
    update-alternatives --install /usr/bin/npm npm /usr/lib/${NODE_FOLDER}/bin/npm ${NODE_INT_VERSION}

    # update $PATH to make `npm install -g` visible
    cat <<EOF >> /home/${SUDO_USER:-$USER}/.bash_profile
    # added by https://gist.github.com/trajakovic/ad9f91776dea3b495db0 - NodeJs 'installer'
    export PATH=\$PATH:/usr/lib/${NODE_FOLDER}/bin
    EOF
    else
    echo Looks like node is already installed:
    echo ""
  5. trajakovic revised this gist Feb 26, 2016. No changes.
  6. trajakovic revised this gist Feb 26, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@ func_check_for_root() {
    func_check_for_root

    #SETUP PARAMS
    NODE_VERSION="v5.0.0"
    NODE_INT_VERSION="500"
    NODE_VERSION="v5.7.0"
    NODE_INT_VERSION="570"
    NODE_FILE=node-${NODE_VERSION}-linux-x64.tar.gz
    NODE_FOLDER=node-${NODE_VERSION}-linux-x64
    NODE_URI="https://nodejs.org/dist/${NODE_VERSION}/${NODE_FILE}"
  7. trajakovic revised this gist Nov 9, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ cd /usr/lib
    if [[ ! -e "${NODE_FOLDER}" ]]; then
    #install DevTools for NPM
    dnf groupinstall -y 'Development Tools'
    dnf install -qy gcc-c++
    dnf install -y gcc-c++

    # get node
    wget ${NODE_URI}
  8. trajakovic revised this gist Nov 8, 2015. No changes.
  9. trajakovic revised this gist Nov 2, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ cd /usr/lib

    if [[ ! -e "${NODE_FOLDER}" ]]; then
    #install DevTools for NPM
    dnf groupinstall -qy 'Development Tools'
    dnf groupinstall -y 'Development Tools'
    dnf install -qy gcc-c++

    # get node
  10. trajakovic revised this gist Nov 2, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@ func_check_for_root() {
    func_check_for_root

    #SETUP PARAMS
    NODE_VERSION="v4.1.1"
    NODE_INT_VERSION="411"
    NODE_VERSION="v5.0.0"
    NODE_INT_VERSION="500"
    NODE_FILE=node-${NODE_VERSION}-linux-x64.tar.gz
    NODE_FOLDER=node-${NODE_VERSION}-linux-x64
    NODE_URI="https://nodejs.org/dist/${NODE_VERSION}/${NODE_FILE}"
  11. trajakovic revised this gist Oct 30, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,7 @@ cd /usr/lib
    if [[ ! -e "${NODE_FOLDER}" ]]; then
    #install DevTools for NPM
    dnf groupinstall -qy 'Development Tools'
    dnf install -qy gcc-c++

    # get node
    wget ${NODE_URI}
  12. trajakovic revised this gist Oct 2, 2015. No changes.
  13. trajakovic revised this gist Oct 2, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -31,5 +31,7 @@ if [[ ! -e "${NODE_FOLDER}" ]]; then
    update-alternatives --install /usr/bin/node node /usr/lib/${NODE_FOLDER}/bin/node ${NODE_INT_VERSION}
    update-alternatives --install /usr/bin/npm npm /usr/lib/${NODE_FOLDER}/bin/npm ${NODE_INT_VERSION}
    else
    echo Looks like node is already installed
    echo Looks like node is already installed:
    echo ""
    update-alternatives --display node
    fi
  14. trajakovic created this gist Oct 2, 2015.
    35 changes: 35 additions & 0 deletions fedora-install-nodejs.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    #!/usr/bin/env bash

    func_check_for_root() {
    if [ ! $( id -u ) -eq 0 ]; then
    echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7
    fi
    }
    func_check_for_root

    #SETUP PARAMS
    NODE_VERSION="v4.1.1"
    NODE_INT_VERSION="411"
    NODE_FILE=node-${NODE_VERSION}-linux-x64.tar.gz
    NODE_FOLDER=node-${NODE_VERSION}-linux-x64
    NODE_URI="https://nodejs.org/dist/${NODE_VERSION}/${NODE_FILE}"

    cd /usr/lib

    if [[ ! -e "${NODE_FOLDER}" ]]; then
    #install DevTools for NPM
    dnf groupinstall -qy 'Development Tools'

    # get node
    wget ${NODE_URI}
    # extract
    tar xvf ${NODE_FILE}
    # remove tar
    rm ${NODE_FILE} -f

    # install alternatives
    update-alternatives --install /usr/bin/node node /usr/lib/${NODE_FOLDER}/bin/node ${NODE_INT_VERSION}
    update-alternatives --install /usr/bin/npm npm /usr/lib/${NODE_FOLDER}/bin/npm ${NODE_INT_VERSION}
    else
    echo Looks like node is already installed
    fi