balena-io-modules / drivelist

List all connected drives in your computer, in all major operating systems
Apache License 2.0
238 stars 90 forks source link

Install fails on Odroid N2 (node-gyp build) #452

Closed thegnuu closed 6 months ago

thegnuu commented 6 months ago

Thank you for this great library! Everything works as expected on my M1 MacBook, but I am not able to build/install this package on an Odroid running Ubuntu 22.04. I verified that the required packages are installed (util-linux and udev), but the installation fails on the node-gyp task.

Am I missing something or is this platform not supported?

npm ERR! code 1
npm ERR! path /home/odroid/backup/node_modules/node-addon-api/node_modules/drivelist
npm ERR! command failed
npm ERR! command sh -c prebuild-install --runtime napi || node-gyp rebuild
npm ERR! make: Entering directory '/home/odroid/backup/node_modules/node-addon-api/node_modules/drivelist/build'
npm ERR!   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR! make: Leaving directory '/home/odroid/backup/node_modules/node-addon-api/node_modules/drivelist/build'
npm ERR! prebuild-install warn install No prebuilt binaries found (target=8 runtime=napi arch=arm64 libc= platform=linux)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@20.11.1 | linux | arm64
npm ERR! gyp info find Python using Python version 3.10.4 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 '/usr/lib/node_modules/npm/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/odroid/backup/node_modules/node-addon-api/node_modules/drivelist/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/odroid/.cache/node-gyp/20.11.1/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/odroid/.cache/node-gyp/20.11.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/odroid/.cache/node-gyp/20.11.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/odroid/backup/node_modules/node-addon-api/node_modules/drivelist',
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! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! make: cc: No such file or directory
npm ERR! make: *** [../node-addon-api/nothing.target.mk:102: Release/obj.target/nothing/../node-addon-api/nothing.o] Error 127
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 4.9.312-22
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/odroid/backup/node_modules/node-addon-api/node_modules/drivelist
npm ERR! gyp ERR! node -v v20.11.1
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

If anyone can point me in a direction to fix this issue this would be highly appreciated!

lurch commented 6 months ago

npm ERR! make: cc: No such file or directory

It seems to think that you don't have a C compiler installed? (cc is usually a symlink to gcc)

thegnuu commented 6 months ago

@lurch thank you very much!

I am officially stupid ;) I checked the installation of gcc, but somehow the symlink was not set properly for whatever reason and I did not realise it calls cc.

Works perfectly now, thanks!