Error: Brunch 2+ requires node v4.0+. Upgrade node or use older brunch for old node.js: npm i -g brunch@1

Problem

Trying to start a new phoenix application while your node installation is old you get the following error:

Error: Brunch 2+ requires node v4.0+. Upgrade node or use older brunch for old node.js: npm i -g brunch@1 -g brunch@1

Solution

You will need to upgrade your node installation by following the steps below:

$> node -v
v0.10.32
$> sudo yum install nodejs npm (if npm is not available)
$> npm cache clean -f
$> npm install -g n
$> sudo /path/n/was/installed(ie /home/kosmas/bin/n) stable
$> node -v
v5.10.1