So I installed npm using npm install uglify-js
I run a command which is:
cat file1.js file2.js .. fileN.js | uglifyjs -o files.min.js
This could also be because of a bug in UglifyJS when reading from stdin. See https://github.com/mishoo/UglifyJS2/issues/85 for details.