Search node_modules in parent directories until the root is reached

This fixes #956.