A common approach is to use scripts in your package.json file to install different versions of packages depending on the environment. You can create scripts that install separate dependencies for development and production.