TBR: Call npm with 'node npm' to avoid shebang line limit.

Change-Id: I2f42f4ebb743f622ef0f2eff8f72cf0cdc2f3415
diff --git a/Makefile b/Makefile
index 2cc130f..1f4f585 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,10 @@
 
 UNAME := $(shell uname)
 
+# 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
+
 .DEFAULT_GOAL := all
 
 # Default browserify options: create a standalone bundle, and use sourcemaps.
@@ -294,7 +298,7 @@
 	make docs
 
 node_modules/ink-docstrap/node_modules/grunt:
-	cd ${DOCSTRAP_LOC}; npm install
+	cd ${DOCSTRAP_LOC}; node $(NPM) install
 
 node_modules/ink-docstrap/bower_components:
 	cd ${DOCSTRAP_LOC}; ${NODE_BIN}/bower install
@@ -317,8 +321,8 @@
 
 node_modules: package.json  check-that-npm-is-in-path
 ifndef NONPMUPDATE
-	@npm prune
-	@npm install --quiet || (rm -fr $(HOME)/.npm && npm install --quiet)
+	@node $(NPM) prune
+	@node $(NPM) install --quiet || (rm -fr $(HOME)/.npm && node $(NPM) install --quiet)
 	@touch node_modules
 endif
 
diff --git a/extension/Makefile b/extension/Makefile
index 56771c0..d0b5b26 100644
--- a/extension/Makefile
+++ b/extension/Makefile
@@ -6,6 +6,10 @@
 SHELL := /bin/bash -e -o pipefail
 .DEFAULT_GOAL := all
 
+# 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 src -name "*.js" -o -name "*.css")
 
 define BROWSERIFY
@@ -147,8 +151,8 @@
 	@$(RM) -fr vanadium.zip build build-test
 
 node_modules: package.json | check-that-npm-is-in-path
-	@npm prune
-	@npm install --quiet
+	@node $(NPM) prune
+	@node $(NPM) install --quiet
 
 check-that-npm-is-in-path:
 	@which npm > /dev/null || { echo "npm is not in the path. Did you remember to run 'jiri profile install v23:nodejs'?"; exit 1; }