From 4b892ae4ff9f79ae753031cc69fc5293842b9890 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Thu, 11 Aug 2011 15:09:05 +0100 Subject: [PATCH] check node and npm version on install --- bin/installDeps.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/installDeps.sh b/bin/installDeps.sh index ece5b7aae..cb3676063 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -20,12 +20,26 @@ hash node > /dev/null 2>&1 || { exit 1 } +#check node version +NODE_VERSION=$(node --version) +if [ ! $(echo $NODE_VERSION | cut -d "." -f 1-2) = "v0.4" ]; then + echo "You're running a wrong version of node, you're using $NODE_VERSION, we need v0.4.x" >&2 + exit 1 +fi + #Is npm installed? hash npm > /dev/null 2>&1 || { echo "Please install npm ( http://npmjs.org )" >&2 exit 1 } +#check npm version +NPM_VERSION=$(npm --version) +if [ ! $(echo $NPM_VERSION | cut -d "." -f 1-2) = "1.0" ]; then + echo "You're running a wrong version of npm, you're using $NPM_VERSION, we need 1.0.x" >&2 + exit 1 +fi + #Does a settings.json exist? if no copy the template if [ ! -f "settings.json" ]; then echo "Copy the settings template to settings.json..."