perhaps a more robust cross platform way to do this is to use npm programatically
https://github.com/isaacs/npm#using-npm-programmatically