TBR: Dont call npm directly, call node npm
Change-Id: Ic3264e712080a3e7bc5ca5cf75b278bb5583b168
diff --git a/client/Makefile b/client/Makefile
index ab71bab..8c46dad 100644
--- a/client/Makefile
+++ b/client/Makefile
@@ -2,6 +2,10 @@
PATH := bin:node_modules/.bin:$(PATH):$(NODE_DIR)/bin
SHELL := /bin/bash -euo pipefail
+# NOTE: we run npm using 'node npm' to avoid relying on the shebang line in the
+# npm script, which can exceed the Linux shebang length limit on Jenkins.
+NPM := $(NODE_DIR)/bin/npm
+
js_files := $(shell find browser -name "*.js")
css_files := $(shell find stylesheets -name "*.css")
host ?= 127.0.0.1
@@ -30,8 +34,8 @@
bin/compile-css $< 1> $@
node_modules: package.json
- @npm prune
- @npm install
+ @node $(NPM) prune
+ @node $(NPM) install
@touch $@
.PHONY: start
@@ -46,7 +50,7 @@
.PHONY: distclean
distclean: clean
- @npm cache clean
+ @node $(NPM) cache clean
.PHONY: dependency-check
dependency-check: package.json node_modules