Why I am unable to run js-beautify? Even after I install it, it doesn't seem to work.
You installed the module locally, which means it's installed in ./node_modules.
The CLI scripts will be installed in ./node_modules/.bin, so you can run them like this:
./node_modules/.bin/js-beautify
However, for modules that install scripts, it's more common to install the module globally, which means it will be installed in a location where the script ends up in a directory that will (probably) be in your $PATH:
[sudo] npm install js-beautify -g