Function Compute provides built-in common dependencies for you to reference in the runtime environment. Function Compute also supports third-party dependencies. This topic describes how to install third-party dependencies on Function Compute.

Background information

For more information about the common dependencies that are built in Function Compute, see the following topics:

Installation method

You can install third-party dependencies by using one of the following methods:

Use the Function Compute console to install dependencies:

  • Package the dependencies and upload them to the console.
    1. Compress the third-party dependencies and code files into a package.
      Notice
      • You must compress all the files in the code directory into a package. The file of the handler function must be in the root directory of the package.
      • The packaging method varies with the operating system. Select a feasible packaging method as needed.
    2. Log on to the Function Compute console, upload the code package by clicking Upload ZIP, Upload Folder, or OSS, and deploy the function.

Use Serverless Devs to install dependencies

Create and deploy functions by using Serverless Devs provided by Function Compute. For more information, see Serverless Devs commands.