Jan 6c5c7f67bb New: NodeJS-Updater 9 years ago
..
README.md 6c5c7f67bb New: NodeJS-Updater 9 years ago
update-nodejs-miniscript.run 6c5c7f67bb New: NodeJS-Updater 9 years ago
update-nodejs.run 6c5c7f67bb New: NodeJS-Updater 9 years ago

README.md

NodeJS Update Script

Tested on: Debian 8.3 Bash: 4.3 ZSH: 5.0.7

Note: if npm is installed, you can simply install the newest stable version of NodeJS with:

su -c "npm install -g n" root
su -c "n stable" root

Table of Contents

  1. Dependencies
  2. Usage
  3. Miniscript
  4. How it operates

Dependencies

Script

  • wget
  • tar
  • git

NodeJS

  • gcc [>= 4.8]
  • g++ [>= 4.8]
  • clang [>= 3.4]
  • clang++ [>= 3.4]
  • python [= 2.7]
  • GNU make [>= 3.8.1] See: NodeJS-Github

Usage

Run with any Shell (tested with bash and zsh).

update-nodejs.run "VERSION" "BUILD-DIR" "CLEAN"

If no argument is used, a help is shown.

VERSION

Can bei either git or any version-number. NON-OPTIONAL argument!

update-nodejs.run 5.5.0

BUILD-DIR

Any directory your user has write-rights to. specifies the PARENT-folder: BUILD-DIR: ~/ means, that it will build in ~/node-VERSION. *defaults to ~/build/nodejs NON-OPTIONAL argument if the CLEAN argument is used as well!

update-nodejs.run "VERSION" ~/my_packages

CLEAN

Can either be YES (in caps) or anything other than that. specifies, if the actual build-directory will be deleted after installing. If set to YES, it will delete BUILD-DIR/node-VERSION. BUILD-DIR will not be deleted. OPTIONAL argument!

update-nodejs.run "VERSION" "BUILD-DIR" YES

Miniscript

Minimal version of the original script.

update-nodejs-miniscript.run "VERSION"

The Miniscript will always use ~/TMP_NODE_BUILDDIR as building-directory. The building-directory will be deleted after installing. Use the Miniscript with care!

How it operates

  1. Downloads specified NodeJS version to BUILD-DIR (either via git clone or wget). See here
    • If node-git already exists, git pull will be used instead. See here
    • If a folder of the same release-version already exists, wget will not download anything. See here
  2. Builds and installs NodeJS with ./configure, make and (as ROOT) make install. See here
  3. Links /usr/local/bin/node to /usr/bin/node (some applications seem to prefer the later). See here