install PM and better index.js main detection