Merge "js/core: On npm failures clean the npm cache and try again."
diff --git a/Makefile b/Makefile
index b15a55e..3dbd24f 100644
--- a/Makefile
+++ b/Makefile
@@ -316,7 +316,7 @@
 node_modules: package.json  check-that-npm-is-in-path
 ifndef NONPMUPDATE
 	@npm prune
-	@npm install --quiet
+	@npm install --quiet || (rm -fr $(HOME)/.npm && npm install --quiet) 
 	@touch node_modules
 endif