node-keyboard
node-keyboard copied to clipboard
Cannot install on ubuntu 16.04
Seems to not compile the native addon properly.
$ npm install -g node-keyboard
/home/aaron/.npm-global/bin/node-keyboard -> /home/aaron/.npm-global/lib/node_modules/node-keyboard/bin/cli.js
> [email protected] install /home/aaron/.npm-global/lib/node_modules/node-keyboard/node_modules/midi
> node-gyp rebuild
make: Entering directory '/home/aaron/.npm-global/lib/node_modules/node-keyboard/node_modules/midi/build'
CXX(target) Release/obj.target/midi/src/node-midi.o
In file included from ../src/node-midi.cpp:6:0:
../src/lib/RtMidi/RtMidi.cpp:1095:28: fatal error: alsa/asoundlib.h: No such file or directory
compilation terminated.
midi.target.mk:97: recipe for target 'Release/obj.target/midi/src/node-midi.o' failed
make: *** [Release/obj.target/midi/src/node-midi.o] Error 1
make: Leaving directory '/home/aaron/.npm-global/lib/node_modules/node-keyboard/node_modules/midi/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.13.0-41-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/aaron/.npm-global/lib/node_modules/node-keyboard/node_modules/midi
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I think it has to do with some aspect of alsa not being available:
In file included from ../src/node-midi.cpp:6:0:
../src/lib/RtMidi/RtMidi.cpp:1095:28: fatal error: alsa/asoundlib.h: No such file or directory
compilation terminated.
I fixed it shortly after writing this.
https://ubuntuforums.org/showthread.php?t=1586707
sudo apt install libasound2-dev