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 "Use built-in modules" section of the following topics:

Installation guide

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

  • Use the :
    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. After you compress the files, make sure that the files of the handler function are placed 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 . Then, upload the on-premises code package to deploy functions. Alternatively, you can upload the code package to Object Storage Service (OSS) and import the code package from OSS.
  • Use Funcraft: You can use Funcraft, which is a command line tool provided by Function Compute, to create and deploy functions. For more information, see Run the fun install command to install third-party dependencies.
  • Use Aliyun Serverless VSCode Extension: You can use Aliyun Serverless VSCode Extension to create and deploy functions. For more information, see Aliyun Serverless VSCode Extension.

References

For more information about how to install third-party dependencies in different runtime environments, see the "Use custom modules" section of the following topics: