Report this

What is the reason for this report?

AppPlatform apt-get support for node-js environment

Posted on December 11, 2020

I am trying to deploy our product to the new app platform, but our node-js app requires some native dependencies (graphics magic, cario, etc…).

The issue is that the node-js environment slug does not allow running apt-get install, or sudo apt-get install. I’m not sure if it’s related to the fact that you are not including the heroku apt buildpack, https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt

apt-get install receives: Reading package lists… E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied

sudo apt-get install receives: sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the ‘nosuid’ option set or an NFS file system without root privileges?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

👋 @rolltable

I don’t have a public release date on it yet, but the team is working on this.

For now, you can deploy via dockerfile where apt install will work.

Are there any news about this request? I’m getting the same error when I try to install linux packages using apt-get install … Thanks

Hi there,

Quick update here, the App Platform now supports this via Aptfile:

https://docs.digitalocean.com/products/app-platform/reference/buildpacks/aptfile/

App Platform looks for a file named Aptfile (no file extension) to detect an application requiring system packages. If this file is detected, the heroku-buildpack-apt buildpack is used to install any packages listed in the Aptfile during the build process.

The following example Aptfile declares three system packages to install:

libpq-dev
imagemagick
curl

This example installs:

  • libpq-dev: A library for PostgreSQL applications.
  • imagemagick: A command-line tool for image processing.
  • curl: A command line tool for making HTTP requests.

Another option here remains the usage of a Dockerfile which gives you more flexibility:

https://docs.digitalocean.com/products/app-platform/reference/dockerfile/

Hope that this helps!

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.