question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use apt-get in EAS build hooks

See original GitHub issue

I’m trying to install some packages with apt-get as mentioned in the Expo docs.

I’ve added the script "eas-build-post-install": "../../scripts/ci/get-translations.sh" in my package.json (using ../../ as my app is in a monorepo) and the get-translations.sh file is being run successfully.

It contains the following lines:

sudo apt-get -y update
sudo apt-get -yq install python-pip
sudo pip install --upgrade pip
sudo pip install transifex-client

The post install script fails with the following output:

[stderr] sudo: apt-get: command not found
[stderr] sudo: apt-get: command not found
[stderr] sudo: pip: command not found
[stderr] sudo: pip: command not found

I also tried running all commands without sudo and still got ‘command not found’ errors.

Please could you explain how to run apt-get in the build hooks?

Here’s a build log in case seen by Expo staff: https://expo.io/accounts/festicket/builds/eb30aac4-bf89-4f55-aa60-a7934f100e5a/logs

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wkozyra95commented, Apr 21, 2021

there is a lot of options

  • based on env $OSTYPE
  • output of uname -S
  • you can check with command -v apt-get before calling apt-get
0reactions
joebournecommented, Apr 21, 2021

For now I’m using a custom env variable called EAS__PLATFORM that I set in eas.json as I couldn’t see any built-in that would do the same here: https://docs.expo.io/build-reference/variables/#built-in-environment-variables

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running E2E tests on EAS Build
This guide explains how to run E2E tests with Detox in a bare workflow project. ... Create eas-hooks/eas-build-pre-install.sh that installs the necessary ...
Read more >
Build lifecycle hooks
Learn how to use the EAS Build lifecycle hooks with npm to customize your build process.
Read more >
Build server infrastructure
Learn about the current build server infrastructure when using EAS. ... use npm hooks to install or update any system dependencies with apt-get...
Read more >
Getting started
Learn how to get started with EAS Update and use in your project.
Read more >
EAS Build
EAS Build is a hosted service for building app binaries for your Expo and React Native projects. It makes building your apps for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found