From 58e9d6cd0b5ff63e6ba566a49cdedcaea897c3db Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 20 Aug 2014 19:06:35 -0400 Subject: [PATCH] CB-7349 Tell users to run npm install when browserify/jasmine-node are missing --- tasks/compile-browserify.js | 7 +++++++ tasks/test.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tasks/compile-browserify.js b/tasks/compile-browserify.js index 1d285108c..549fc0cd2 100644 --- a/tasks/compile-browserify.js +++ b/tasks/compile-browserify.js @@ -16,6 +16,13 @@ * specific language governing permissions and limitations * under the License. */ +try { + require('browserify'); +} catch (e) { + console.error("\nbrowserify is not installed, you need to:\n\trun `npm install` from " + require('path').dirname(__dirname)+"\n"); + process.exit(1); +} + var generate = require('./lib/packager-browserify'); module.exports = function(grunt) { diff --git a/tasks/test.js b/tasks/test.js index edd649148..b1df54e14 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -16,6 +16,13 @@ * specific language governing permissions and limitations * under the License. */ +try { + require('jasmine-node'); +} catch (e) { + console.error("\njasmine-node is not installed, you need to:\n\trun `npm install` from " + require('path').dirname(__dirname)+"\n"); + process.exit(1); +} + module.exports = function(grunt) { grunt.registerTask('_test', 'Runs test in node', function() { var done = this.async();