brain.js icon indicating copy to clipboard operation
brain.js copied to clipboard

Does not install or run on redhat linux

Open dlandtaa opened this issue 3 years ago • 2 comments

image

What is wrong?

Cannot install or run on redhat linux (amazon ec2 instance running amazon linux)

Linux version 4.14.294-220.533.amzn2.aarch64 (mockbuild@ip-10-0-52-76)
(gcc version 7.3.1 20180712 (Red Hat 7.3.1-15) (GCC)) #1 SMP Thu Sep 29 01:01:24 UTC 2022

Where does it happen?

Inside ec2 amazon linux instance

How do we replicate the issue?

  1. Create new ec2 instance running amazon linux
  2. npm init
  3. npm instal brain.js
 npm i brain.js
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm ERR! code 1
npm ERR! path /home/ec2-user/temp/node_modules/gl
npm ERR! command failed
npm ERR! command sh -c -- prebuild-install || node-gyp rebuild
npm ERR! prebuild-install warn install No prebuilt binaries found (target=16.18.0 runtime=node arch=arm64 libc= platform=linux)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp info find Python using Python version 3.7.10 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/ec2-user/temp/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ec2-user/temp/node_modules/gl/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ec2-user/temp/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/ec2-user/.cache/node-gyp/16.18.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/ec2-user/.cache/node-gyp/16.18.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/ec2-user/temp/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/ec2-user/.cache/node-gyp/16.18.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/ec2-user/temp/node_modules/gl',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Package x11 was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `x11.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'x11' found
npm ERR! Package xi was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `xi.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'xi' found
npm ERR! Package xext was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `xext.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'xext' found
npm ERR! gyp: Call to 'pkg-config --libs-only-L --libs-only-other x11 xi xext' returned exit status 1 while in angle/src/angle.gyp. while loading dependencies of binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/home/ec2-user/temp/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 4.14.294-220.533.amzn2.aarch64
npm ERR! gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v16.18.0-linux-arm64/bin/node" "/home/ec2-user/temp/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/ec2-user/temp/node_modules/gl
npm ERR! gyp ERR! node -v v16.18.0
npm ERR! gyp ERR! node-gyp -v v9.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ec2-user/.npm/_logs/2022-12-02T04_43_57_018Z-debug-0.log

Expected behavior (i.e. solution)

Should install without issue

Version information

Nodejs:

v16.18.0

Browser:

n/a

Brain.js:

2.0.0-beta.17

How important is this (1-5)?

To me? 5

Other Comments

dlandtaa avatar Dec 02 '22 04:12 dlandtaa

The logs indicate you are missing some packages. Try sudo dnf install libX11-devel libXi-devel libXext-devel

TimidFuzz avatar May 13 '23 12:05 TimidFuzz

Please note that even after these all dependencies are installed, you may still run into other problems due to the headless-gl dependency. For more details, see:

  • https://github.com/stackgl/headless-gl/issues/271#issuecomment-1962495138

zFernand0 avatar Feb 24 '24 18:02 zFernand0