Add support for npm 2
Merge pull request #2249 from Gared/support_npm2

Add support for npm 2