check if package.json exists and handle accordingly