Skip to content

Instantly share code, notes, and snippets.

@undirectlookable
Last active December 10, 2020 22:12
Show Gist options
  • Select an option

  • Save undirectlookable/a474ba7838d1a0141591 to your computer and use it in GitHub Desktop.

Select an option

Save undirectlookable/a474ba7838d1a0141591 to your computer and use it in GitHub Desktop.

Revisions

  1. undirectlookable revised this gist Feb 2, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions rpi-nodejs-install.sh
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@

    # Get the latest Node.js Binaries filename
    # Result like: node-v5.5.0-linux-armv6l.tar.gz
    # For RPi2 Model B, replace "armv6l" with "armv7l".
    FILENAME=`wget -q -O - https://nodejs.org/dist/latest/SHASUMS256.txt | grep linux-armv6l.tar.gz | sed 's/^[0-9a-f]\+\s*//g'`

    # Download
  2. undirectlookable created this gist Feb 2, 2016.
    32 changes: 32 additions & 0 deletions rpi-nodejs-install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    #!/usr/bin/env bash
    # Install Node.js Binaries on Raspberry Pi A/A+/B/B+ (ARMv6 CPU).

    # Get the latest Node.js Binaries filename
    # Result like: node-v5.5.0-linux-armv6l.tar.gz
    FILENAME=`wget -q -O - https://nodejs.org/dist/latest/SHASUMS256.txt | grep linux-armv6l.tar.gz | sed 's/^[0-9a-f]\+\s*//g'`

    # Download
    if [ ! -f $FILENAME ]; then
    wget --no-check-certificate https://nodejs.org/dist/latest/$FILENAME
    fi

    # Folder name
    FOLDER=${FILENAME::-7}

    # Remove old files
    [ -d $FOLDER ] && rm -rf $FOLDER

    # Extract
    tar -zxf $FILENAME

    # Remove unnecessary files
    cd $FOLDER
    rm README.md CHANGELOG.md LICENSE

    # Copy as install
    cd ..
    cp -R $FOLDER/* /usr/local/

    echo "Done!"
    echo "Node `node -v`"
    echo "NPM `npm -v`"
    10 changes: 10 additions & 0 deletions rpi-nodejs-remove.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/usr/bin/env bash
    # Remove Node.js from your Raspbian.

    rm /usr/local/bin/node
    rm /usr/local/bin/npm
    rm -rf /usr/local/include/node
    rm -rf /usr/local/lib/node_modules
    rm -rf /usr/local/share/doc/node
    rm /usr/local/share/man/man1/node.1
    rm /usr/local/share/systemtap/tapset/node.stp