Don't build without a package.json. Fixes #3049.