Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker node flow-bin libelf.so.1 not found (gitlab ci)

While running FlowJS check node_modules/.bin/flow check inside docker image based on node:latest (currently 6.5)

You see error

$ npm i

...

npm info lifecycle [email protected]~postinstall: [email protected]

> [email protected] postinstall .../node_modules/flow-bin
> node lib/install.js

✖ The `.../node_modules/flow-bin/vendor/flow` binary doesn't seem to work correctly
✖ flow binary test failed

...

$ node_modules/.bin/flow check
.../node_modules/flow-bin/vendor/flow: error while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory
ERROR: Build failed: exit code 1

E.g. flow cannot be run under vanilla node:latest docker image

like image 907
Wile E. Avatar asked Jun 14 '26 13:06

Wile E.


1 Answers

Related issue https://github.com/facebook/flow/issues/210

In case your image is from node:latest (which is debian:jessie under the hood) you need to add a little bit update to apt:

$ apt-get update -qq
$ apt-get install -qy libelf1

before any runs (e.g. in Dockerfile or corresponding section of .gitlab-ci.yml)

like image 178
Wile E. Avatar answered Jun 17 '26 16:06

Wile E.