Difference between revisions of "NodeJS"

From SME Server
Jump to navigationJump to search
m
m
Line 11: Line 11:
 
This will install nodejs plus c-ares19, http-parser, libuv and v8 from the epel repo, plus libicu from the base repo.
 
This will install nodejs plus c-ares19, http-parser, libuv and v8 from the epel repo, plus libicu from the base repo.
  
'''Update'''
+
==Updating==
 
* Update using
 
* Update using
 
  yum --enablerepo=epel update nodejs c-ares19 http-parser libuv v8
 
  yum --enablerepo=epel update nodejs c-ares19 http-parser libuv v8
Line 20: Line 20:
 
{{Warning box|This procedure requires installation of gcc and could significantly compromise your server's security.<br />Thorough understanding of linux system management is required.<br /><br /><b>Proceed at your own risk</b>}}
 
{{Warning box|This procedure requires installation of gcc and could significantly compromise your server's security.<br />Thorough understanding of linux system management is required.<br /><br /><b>Proceed at your own risk</b>}}
  
===Prerequesites===
+
==Prerequesites==
 
* Requires Python 2.7 installed as described in [[Python Altinstall]]
 
* Requires Python 2.7 installed as described in [[Python Altinstall]]
 
* git and g++
 
* git and g++
 
  yum -y install git gcc-c++
 
  yum -y install git gcc-c++
  
===Install===
+
==Install==
 
  mkdir -p /var/git
 
  mkdir -p /var/git
 
  cd /var/git
 
  cd /var/git
Line 37: Line 37:
 
  make
 
  make
 
  make install
 
  make install
<headertabs/>
 
  
===Update===
+
 
 +
===Updating===
 
  RELEASE=$(curl -s http://nodejs.org/download/ |grep Current\ version |awk -F"[><]" '{print $5}')
 
  RELEASE=$(curl -s http://nodejs.org/download/ |grep Current\ version |awk -F"[><]" '{print $5}')
 
  cd /var/git/node
 
  cd /var/git/node
 
  git reset --hard
 
  git reset --hard
 
  git pull origin $RELEASE-release
 
  git pull origin $RELEASE-release
 +
<headertabs/>
  
 
===Test===
 
===Test===

Revision as of 10:39, 9 October 2014

Node.js® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

http://nodejs.org/

[edit]

On SME 9, you can install a reasonably recent version of NodeJS from the EPEL repository:

  • Add the epel repository to the configuration db using the SME 9 instructions from Epel
  • Update the yum configuration file using
expand-template /etc/yum.smerepos.d/sme-base.repo
  • Install NodeJS
yum --enablerepo=epel install nodejs

This will install nodejs plus c-ares19, http-parser, libuv and v8 from the epel repo, plus libicu from the base repo.

Updating

  • Update using
yum --enablerepo=epel update nodejs c-ares19 http-parser libuv v8
  • NodeJS updates are released every 3 - 12 weeks; check for updates regularly.
PythonIcon.png Skill level: Advanced
The instructions on this page may require deviations from standard procedures. A good understanding of linux and Koozali SME Server is recommended.


Warning.png Warning:
This procedure requires installation of gcc and could significantly compromise your server's security.
Thorough understanding of linux system management is required.

Proceed at your own risk


Prerequesites

yum -y install git gcc-c++

Install

mkdir -p /var/git
cd /var/git
RELEASE=$(curl -s http://nodejs.org/download/ |grep Current\ version |awk -F"[><]" '{print $5}')
git clone https://github.com/joyent/node.git
cd /var/git/node
git reset --hard
git checkout $RELEASE
export PYTHON=/usr/local/bin/python2.7
$PYTHON ./configure
make
make install


Updating

RELEASE=$(curl -s http://nodejs.org/download/ |grep Current\ version |awk -F"[><]" '{print $5}')
cd /var/git/node
git reset --hard
git pull origin $RELEASE-release

Test

node -v