From 2ca6acc1e975ca82b93071f550062d682d8ec2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Bu=CC=88nemann?= Date: Sat, 31 Oct 2015 05:36:35 +0100 Subject: [PATCH] Fix npm 3 build failure in phantomjs task npm v3.0+ by default dedupes node modules and stores them in a flat tree, which means the hardcoded path to the location.js will no longer be nested under the karma-phantomjs-launcher module. This fixes issue #2999. --- tasks/options/phantomjs.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/options/phantomjs.js b/tasks/options/phantomjs.js index 7eac7cb36ac..300688f5ba2 100644 --- a/tasks/options/phantomjs.js +++ b/tasks/options/phantomjs.js @@ -6,6 +6,11 @@ module.exports = function(config,grunt) { var dest = './vendor/phantomjs/phantomjs'; var confDir = './node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/' + if (!grunt.file.exists(confDir)) { + // npm 3 or npm 2 with dedupe + confDir = './node_modules/phantomjs/lib/'; + } + if (!grunt.file.exists(dest)){ var m=grunt.file.read(confDir+"location.js")