For anyone who's interested, this is the magic that fixes the npm install issue where it sometimes does not install some nested modules correctly.