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
In my case I had forgotten to close some open functions in my javascript. Make sure you have all of your semicolons properly closed too.