From d370a5b76f2046b93b6131f5f90fb31c43aff38f Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Thu, 26 Jan 2012 12:55:54 +0100 Subject: [PATCH] Improved npm and node version checks --- bin/installDeps.sh | 7 +++++++ package.json | 3 +++ 2 files changed, 10 insertions(+) diff --git a/bin/installDeps.sh b/bin/installDeps.sh index a3f767a24..8580387db 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -33,6 +33,13 @@ if [ ! $(echo $NPM_VERSION | cut -d "." -f 1) = "1" ]; then exit 1 fi +#check node version +NODE_VERSION=$(node --version) +if [ ! $(echo $NODE_VERSION | cut -d "." -f 1-2) = "v0.6" ]; then + echo "You're running a wrong version of node, you're using $NODE_VERSION, we need v0.6.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..." diff --git a/package.json b/package.json index a24e96088..a515f2dd1 100644 --- a/package.json +++ b/package.json @@ -26,5 +26,8 @@ "devDependencies": { "jshint" : "*" }, + "engines" : { "node" : ">=0.6.0", + "npm" : ">=1.0" + }, "version" : "1.0.0" }