Fallback to module installs if package.json is missing in a local folder install

Fixes #6117
Yes. The first time is to make sure that require actually loads the module from disk. The second is to ensure that any other tests run by the test runner don't get our mock.