Google Cloud Functions (GCF) manages dependencies through a file named package.json, located in the function’s root directory. This file lists all Node.js dependencies required by the function. When deploying the function, GCF installs these dependencies using npm install command. For Python functions, requirements.txt is used instead of package.json. It contains pip packages needed for the function. During deployment, GCF installs these packages with pip install -r requirements.txt. If there are private modules or those not hosted on npm registry, they can be included in the function’s local node_modules folder and will be uploaded during deployment.