How can I install a tool such as texlive (or any other standard Fedora and/or Debian package) in my function's runtime?


I have started using Netlify for more complex projects (beyond static websites) using Next.js and I was wondering if there was a way to install dependencies such as texlive in the runtime environment of the Next.js API functions?


That won’t be possible. API routes run on AWS Lambda, so you can only get the packages that might be preinstalled in that, or use any Node-packages.

You can get it to work if there’s a simple shell script that you can include along with your function, but won’t be able to install any packages on demand.

Do you have any plans to support layers?

Hey there, @automaticFix :wave:

Can you tell us more about your use case for layers and how you envision implementing it? I will share this with our dev team once I have more information. Thanks!

Hi @hillary :slightly_smiling_face:

Some of my use cases are:

  • Creating an API endpoint that receives as input some LaTex code and renders it in PDF, for example. For that I need sopmething like TexLive in my function’s runtime.
  • There are some libraries that depend on Graphivz being available on the path. If I want to implement an API that receives some Graphviz dot code and responds with the SVG rendering of the graph, I need graphviz to be available in the function’s runtime.

Another option is perhaps supporting Creating Lambda container images - AWS Lambda.

Out of curiosity, how do your other customers currently implement features like these? By using custom solutions?


No immediate plans to support Layers, I’m afraid. I haven’t seen a lot of people (if any) try what you are trying, so not sure what folks might be using.