I'm having trouble even explaining this one.
I want the desired behaviour as below for npm install (each package has a sub-folder)
But for some projects it seems to install all the dependencies like this.
npm 3+ has a new feature where it tries to install modules and dependancies in as flat a structure as possible.
More information in v3.0.0 changelog.
npm installfetch and save the dependencies in folders as per the name of the package, as opposed to them all being in the one (node_modules) folder.