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

Fixes #6117