midi2-dev / MIDI2.0Workbench

MIDI 2.0 Testing Tool
MIT License
41 stars 5 forks source link

Ubuntu 24.04- Cannot compute electron version/The engine "node" is incompatible with this module #11

Closed Oattsplease closed 2 months ago

Oattsplease commented 3 months ago

Experiencing this issue building on Ubuntu, from what I can gather it's either an issue with the version of electron that's installed/not installed or the node add-on API isn't meshing properly

I am very new to this, if there are any other details I can provide, I'm happy to do so. Thanks in advance!

System Details: Macbook Pro 14,1 Intel® Core™ i7-7660U × 4 Ubuntu 24.04 LTS Kernel: Linux 6.8.0-35-generic 64-bit GNOME Version: 46

Error: yarnpkg

$ electron-builder --publish=never
  • electron-builder  version=24.13.3 os=6.8.0-35-generic
  • loaded configuration  file=package.json ("build" field)
  ⨯ Cannot compute electron version from installed node modules - none of the possible electron modules are installed and version ("^19.1.9") is not fixed in project.
See https://github.com/electron-userland/electron-builder/issues/3984#issuecomment-504968246
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

yarn install details: yarnpkg run build

info No lockfile found.
[1/4] Resolving packages...
warning node-gyp > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning node-gyp > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning node-gyp > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning node-gyp > npmlog@6.0.2: This package is no longer supported.
warning node-gyp > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning node-gyp > npmlog > gauge@4.0.4: This package is no longer supported.
warning node-gyp > npmlog > are-we-there-yet@3.0.1: This package is no longer supported.
warning node-gyp > make-fetch-happen > cacache > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning node-gyp > make-fetch-happen > cacache > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning node-gyp > make-fetch-happen > cacache > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
warning node-gyp > make-fetch-happen > cacache > @npmcli/move-file > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning bonjour-service > tape > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning bonjour-service > ts-node-dev > rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
warning bonjour-service > ts-node-dev > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning bonjour-service > eslint > @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
warning bonjour-service > eslint > file-entry-cache > flat-cache > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning bonjour-service > eslint > @humanwhocodes/config-array > @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
warning glob@7.2.3: Glob versions prior to v9 are no longer supported
warning Resolution field "automation-events@4.0.14" is incompatible with requested version "automation-events@^7.0.5"
warning electron-builder > app-builder-lib > electron-osx-sign@0.6.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different
warning electron-builder > app-builder-lib > @electron/universal > asar@3.2.0: Please use @electron/asar moving forward.  There is no API change, just a package name change
warning electron-builder > app-builder-lib > @electron/universal > asar > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning electron-icon-builder > icon-gen > del > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning electron-icon-builder > icon-gen > svg2png > phantomjs-prebuilt@2.1.16: this package is now deprecated
warning electron-icon-builder > icon-gen > svg2png > phantomjs-prebuilt > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning electron-icon-builder > icon-gen > svg2png > phantomjs-prebuilt > request > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning electron-icon-builder > icon-gen > svg2png > phantomjs-prebuilt > request > har-validator@5.1.5: this library is no longer supported
warning electron-icon-builder > jimp > @jimp/custom > @jimp/core > phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning electron-icon-builder > jimp > @jimp/plugins > @jimp/plugin-print > load-bmfont > phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
[2/4] Fetching packages...
error node-addon-api@8.0.0: The engine "node" is incompatible with this module. Expected version "^18 || ^20 || >= 21". Got "16.20.2"
error Found incompatible module.
Oattsplease commented 3 months ago

Tried @MusicMaker 's fix in this issue By trying node 18, however I experienced other issues thereafter:

Error: yarnpkg run start

$ electron .
[20070:0626/001916.503274:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/electron/dist/electron exited with signal SIGTRAP
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

These two commands seemed to progress me past this issue:

oatt@oatt-MacBookPro14-1:~/MIDI2.0WB/MIDI2.0Workbench/node_modules/electron/dist$ sudo chown root:root chrome-sandbox
oatt@oatt-MacBookPro14-1:~/MIDI2.0WB/MIDI2.0Workbench/node_modules/electron/dist$ sudo chmod 4755 chrome-sandbox

However another issue popped up:

When trying : yarnpkg run start

$ electron .
App threw an error during load
Error: Could not locate the bindings file. Tried:
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/Debug/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/Release/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/out/Debug/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/Debug/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/out/Release/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/Release/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/default/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/compiled/16.14.2/linux/x64/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/addon-build/release/install-root/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/addon-build/debug/install-root/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/addon-build/default/install-root/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/lib/binding/node-v106-linux-x64/midi.node
    at bindings (/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/midi.js:1:31)
    at Module._compile (node:internal/modules/cjs/loader:1118:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/oatt/MIDI2.0WB/MIDI2.0Workbench/libs/UMPMIDI1.js:5:12)

Writing Node.js report to file: report.20240626.002255.20302.0.001.json
Node.js report completed
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Could not locate the bindings file. Tried:
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/Debug/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/Release/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/out/Debug/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/Debug/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/out/Release/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/Release/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/default/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/compiled/16.14.2/linux/x64/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/addon-build/release/install-root/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/addon-build/debug/install-root/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/addon-build/default/install-root/midi.node
 → /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/lib/binding/node-v106-linux-x64/midi.node
    at bindings (/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/midi.js:1:31)
    at Module._compile (node:internal/modules/cjs/loader:1118:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/oatt/MIDI2.0WB/MIDI2.0Workbench/libs/UMPMIDI1.js:5:12)

Updated yarnpkg

   yarn install v1.22.19
info No lockfile found.
[1/4] Resolving packages...
warning node-gyp > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning node-gyp > npmlog@6.0.2: This package is no longer supported.
warning node-gyp > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning node-gyp > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning node-gyp > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning node-gyp > npmlog > are-we-there-yet@3.0.1: This package is no longer supported.
warning node-gyp > npmlog > gauge@4.0.4: This package is no longer supported.
warning node-gyp > make-fetch-happen > cacache > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning node-gyp > make-fetch-happen > cacache > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning node-gyp > make-fetch-happen > cacache > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
warning node-gyp > make-fetch-happen > cacache > @npmcli/move-file > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning bonjour-service > ts-node-dev > rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
warning bonjour-service > ts-node-dev > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning bonjour-service > tape > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning bonjour-service > eslint > @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
warning bonjour-service > eslint > file-entry-cache > flat-cache > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning bonjour-service > eslint > @humanwhocodes/config-array > @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
warning glob@7.2.3: Glob versions prior to v9 are no longer supported
warning Resolution field "automation-events@4.0.14" is incompatible with requested version "automation-events@^7.0.5"
warning electron-builder > app-builder-lib > electron-osx-sign@0.6.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different
warning electron-builder > app-builder-lib > @electron/universal > asar@3.2.0: Please use @electron/asar moving forward.  There is no API change, just a package name change
warning electron-builder > app-builder-lib > @electron/universal > asar > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning electron-icon-builder > jimp > @jimp/custom > @jimp/core > phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning electron-icon-builder > jimp > @jimp/custom > @jimp/core > load-bmfont > phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning electron-icon-builder > icon-gen > del > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning electron-icon-builder > icon-gen > svg2png > phantomjs-prebuilt@2.1.16: this package is now deprecated
warning electron-icon-builder > icon-gen > svg2png > phantomjs-prebuilt > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning electron-icon-builder > icon-gen > svg2png > phantomjs-prebuilt > request > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning electron-icon-builder > icon-gen > svg2png > phantomjs-prebuilt > request > har-validator@5.1.5: this library is no longer supported
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/8] ⠄ waiting...
[2/8] ⠄ midi
[6/8] ⠄ electron
[7/8] ⡀ phantomjs-prebuilt
error /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@10.1.0
gyp info using node@18.20.3 | linux | x64
gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"

gyp http GET https://nodejs.org/download/release/v18.20.3/node-v18.20.3-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v18.20.3/node-v18.20.3-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v18.20.3/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v18.20.3/SHASUMS256.txt
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/home/oatt/.nvm/versions/node/v18.20.3/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/oatt/.nvm/versions/node/v18.20.3/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/oatt/.cache/node-gyp/18.20.3/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/oatt/.cache/node-gyp/18.20.3',
gyp info spawn args '-Dnode_gyp_dir=/home/oatt/.nvm/versions/node/v18.20.3/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/oatt/.cache/node-gyp/18.20.3/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build'
  CXX(target) Release/obj.target/midi/vendor/rtmidi/RtMidi.o
../vendor/rtmidi/RtMidi.cpp:1543:10: fatal error: alsa/asoundlib.h: No such file or directory
 1543 | #include <alsa/asoundlib.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [midi.target.mk:120: Release/obj.target/midi/vendor/rtmidi/RtMidi.o] Error 1
make: Leaving directory '/home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/home/oatt/.nvm/versions/node/v18.20.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
gyp ERR! System Linux 6.8.0-35-generic
gyp ERR! command "/home/oatt/.nvm/versions/node/v18.20.3/bin/node" "/home/oatt/.nvm/versions/node/v18.20.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/oatt/MIDI2.0WB/MIDI2.0Workbench/node_modules/midi

to note: whenever I need to run chrome I have to write google-chrome --in-process-gpu in order for it to start. I also tried yarnpkg run start --in-process-gpu but that did not work

Oattsplease commented 3 months ago

Solution to yarnpkg - from this thread sudo apt-get install libasound2-dev

yarnpkg output fine,

since it rebuilt all the dependencies, I also had to add perms again: node_modules/electron/dist $ sudo chown root:root chrome-sandbox node_modules/electron/dist $ sudo chmod 4755 chrome-sandbox

then it finally launched!!

starfishmod commented 2 months ago

@Oattsplease thanks for looking into this more. I have updated the read.me to include the libasound2-dev package. If that is all I need to do can I close this issue?

Oattsplease commented 2 months ago

Main fixes were: sudo apt-get install libasound2-dev inside the project root, and then perms updates: node_modules/electron/dist $ sudo chown root:root chrome-sandbox node_modules/electron/dist $ sudo chmod 4755 chrome-sandbox

Good to close!