THRIFT-4351: use travis build stages to optimize build,
avoiding duplicate rebuilds of the same image, and also
allow personal docker hub repositories for private fork
builds to be optimized. Move ubsan build to artful image
because it catches more stuff and fix what was found.

THRIFT-4345: solidify docker build strategy for maximum
coverage: trusty, xenial, artful as stock as they can be

THRIFT-4344: add top level language summary markdown and
update readme with a new image on the layered architecture

THRIFT-3847: remove VERSION macro from config.h which
was causing a conflict on artful builds.

THRIFT-4359: fix haxe map/set decode when key is binary,
as a missing break statement caused it to use an int
during decode

This closes #1389
diff --git a/lib/nodejs/Makefile.am b/lib/nodejs/Makefile.am
index a3424d0..9a7b4eb 100755
--- a/lib/nodejs/Makefile.am
+++ b/lib/nodejs/Makefile.am
@@ -15,12 +15,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# We call npm twice to work around npm issues
 
 stubs: $(top_srcdir)/test/ThriftTest.thrift
 	$(THRIFT) --gen js:node -o test/ $(top_srcdir)/test/ThriftTest.thrift
 
 deps: $(top_srcdir)/package.json
-	$(NPM) install --no-bin-links $(top_srcdir)/
+	$(NPM) install $(top_srcdir)/ || $(NPM) install $(top_srcdir)/
 
 all-local: deps