Although you can run npm from within any subdirectory of your project, the node_modules directory will be installed at the toplevel.. Where "toplevel" is defined as "next to package.json".