Kwaadpepper / msi-keyboard-CLI

Just a nodejs cli to control https://github.com/stevelacy/msi-keyboard
http://freethepepper.com
GNU General Public License v2.0
64 stars 14 forks source link

failed node-hid #17

Open sergy8612 opened 7 years ago

sergy8612 commented 7 years ago

Hi,

after following installation instructions, then clone git project and after npm-install I got the following message, I leave a capture of my shell, I'm using Ubuntu 16.04 Xenial

root@sergio-GE72-6QD:/home/sergio/msi-klm/msi-keyboard-CLI# npm install

node-hid@0.5.2 install /home/sergio/msi-klm/msi-keyboard-CLI/node_modules/node-hid node-pre-gyp install --fallback-to-build

/usr/bin/env: «node»: No existe el archivo o el directorio msi-keyboard-cli@1.3.3 /home/sergio/msi-klm/msi-keyboard-CLI └── minimist@1.2.0

npm ERR! Linux 4.4.0-57-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! node v4.2.6 npm ERR! npm v3.5.2 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn

npm ERR! node-hid@0.5.2 install: node-pre-gyp install --fallback-to-build npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the node-hid@0.5.2 install script 'node-pre-gyp install --fallback-to-build'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the node-hid package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-pre-gyp install --fallback-to-build npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs node-hid npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls node-hid npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/sergio/msi-klm/msi-keyboard-CLI/npm-debug.log

I also provide the npm-debug.log https://s3-eu-west-1.amazonaws.com/trantor-files/npm-debug.log

Any help will be appreciated. Thank you for your work.

Kwaadpepper commented 7 years ago

could you try npm install msi-keyboard-cli ?

Also here are some tips to make it work https://github.com/node-hid/node-hid/issues/144 To resume :

sergy8612 commented 7 years ago

Hi,

I don't know if you're having problems building node-hid or can help, but this is what I actually get after npm install node-hid (and having just upgraded nodejs to latest version):

root@sergio-GE72-6QD:/home/sergio/msi-klm# npm install node-hid

node-hid@0.5.2 install /home/sergio/msi-klm/node_modules/node-hid
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/node-hid/node-hid/releases/download/0.5.2/HID-v0.5.2-node-v51-linux-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for node-hid@0.5.2 and node@7.3.0 (node-v51 ABI) (falling back to source compile with node-gyp) gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/7.3.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/sergio/msi-klm/node_modules/node-hid/.node-gyp" make: se entra en el directorio '/home/sergio/msi-klm/node_modules/node-hid/build' make: *** No hay ninguna regla para construir el objetivo '../.node-gyp/7.3.0/include/node/common.gypi', necesario para 'Makefile'. Alto. make: se sale del directorio '/home/sergio/msi-klm/node_modules/node-hid/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:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Linux 4.4.0-57-generic gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/sergio/msi-klm/node_modules/node-hid/build/HID/Release/HID.node" "--module_name=HID" "--module_path=/home/sergio/msi-klm/node_modules/node-hid/build/HID/Release" gyp ERR! cwd /home/sergio/msi-klm/node_modules/node-hid gyp ERR! node -v v7.3.0 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/sergio/msi-klm/node_modules/node-hid/build/HID/Release/HID.node --module_name=HID --module_path=/home/sergio/msi-klm/node_modules/node-hid/build/HID/Release' (1) node-pre-gyp ERR! stack at ChildProcess. (/home/sergio/msi-klm/node_modules/node-hid/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at emitTwo (events.js:106:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:885:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) node-pre-gyp ERR! System Linux 4.4.0-57-generic node-pre-gyp ERR! command "/usr/bin/nodejs" "/home/sergio/msi-klm/node_modules/node-hid/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /home/sergio/msi-klm/node_modules/node-hid node-pre-gyp ERR! node -v v7.3.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.31 node-pre-gyp ERR! not ok Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/sergio/msi-klm/node_modules/node-hid/build/HID/Release/HID.node --module_name=HID --module_path=/home/sergio/msi-klm/node_modules/node-hid/build/HID/Release' (1) npm WARN enoent ENOENT: no such file or directory, open '/home/sergio/msi-klm/package.json' npm WARN msi-klm No description npm WARN msi-klm No repository field. npm WARN msi-klm No README data npm WARN msi-klm No license field. npm ERR! Linux 4.4.0-57-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-hid" npm ERR! node v7.3.0 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE

npm ERR! node-hid@0.5.2 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-hid@0.5.2 install script 'node-pre-gyp install --fallback-to-build'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the node-hid package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-pre-gyp install --fallback-to-build npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs node-hid npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls node-hid npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/sergio/msi-klm/npm-debug.log

this is the ubuntu distro I'm using:

root@sergio-GE72-6QD:/home/sergio/msi-klm# lsb_release -a LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial

and of course I have installed libusb-1.0-0-dev

It seems as if all this is due to https://github.com/node-hid/node-hid/releases/download/0.5.2/HID-v0.5.2-node-v51-linux-x64.tar.gz is no longer available, right? I don't quite understand any of this.

I posted the same in the thread you referenced. I followed all these three tips and it doesn't work yet. I don't know what I'm is wrong. All this worked me some months ago.

Best regards

Kwaadpepper commented 7 years ago

I reported this https://github.com/node-hid/node-hid/issues/175

sergy8612 commented 7 years ago

Hi,

I tried installing manually node-hid just as @todbot commented in https://github.com/node-hid/node-hid#compiling-from-source under /msi-keyboard-CLI/node_modules by following the steps

git clone https://github.com/node-hid/node-hid.git cd node-hid # must change into node-hid directory git submodule update --init # done on publish automatically npm install # rebuilds the module node-pre-gyp rebuild # rebuilds the C code

It seems to be installed successfully. Now trying again npm install this is what I get:

`root@sergio-GE72-6QD:/home/sergio/msi-klm/msi-keyboard-CLI# npm install npm ERR! Linux 4.4.0-57-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! node v7.4.0 npm ERR! npm v4.0.5 npm ERR! path /home/sergio/msi-klm/msi-keyboard-CLI/node_modules/node-hid npm ERR! code EISGIT

npm ERR! git /home/sergio/msi-klm/msi-keyboard-CLI/node_modules/node-hid: Appears to be a git repo or submodule. npm ERR! git /home/sergio/msi-klm/msi-keyboard-CLI/node_modules/node-hid npm ERR! git Refusing to remove it. Update manually, npm ERR! git or move it out of the way first.

npm ERR! Please include the following file with any support request: npm ERR! /home/sergio/msi-klm/msi-keyboard-CLI/npm-debug.log ` I attach npm-debug file if it can help.

npm-debug.log.txt

Regards.

todbot commented 7 years ago

Hi @sergy8612, I've never tried inserting node-hid into another node project like that. I'm not sure if it would work. I would suggest rather to create a new directory someplace else and just installing node-hid like normal, and seeing what happens.

For instance:

mkdir ~/node-hid-tst
cd ~/node-hid-tst
npm init -y
npm install node-hid
node ./node_modules/node-hid/src/show-devices.js
Kwaadpepper commented 7 years ago

Please try this sudo ln -s /usr/bin/nodejs /usr/bin/node, and install again.

TheSHEEEP commented 7 years ago

None of the suggestions here helped so far, I'm getting this error:

sudo npm install msi-keyboard-cli -g
/usr/bin/msikeyboard -> /usr/lib/node_modules/msi-keyboard-cli/msibacklight
node-hid@0.5.4 install /usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid
node-pre-gyp install --fallback-to-build
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/bin/nodejs',
node-pre-gyp verb cli   '/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli   'install',
node-pre-gyp verb cli   '--fallback-to-build' ]
node-pre-gyp info using node-pre-gyp@0.6.31
node-pre-gyp info using node@8.1.0 | linux | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build/Release/HID.node" (not found)
node-pre-gyp http GET https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v57-linux-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v57-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for node-hid@0.5.4 and node@8.1.0 (node-v57 ABI) (falling back to source compile with node-gyp) 
node-pre-gyp http EACCES: permission denied, mkdir '/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build' 
node-pre-gyp verb command build [ 'rebuild' ]
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build'
gyp ERR! System Linux 4.4.0-79-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build/Release/HID.node" "--module_name=HID" "--module_path=/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build/Release"
gyp ERR! cwd /usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid
gyp ERR! node -v v8.1.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build/Release/HID.node --module_name=HID --module_path=/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build/Release' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:887:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
node-pre-gyp ERR! System Linux 4.4.0-79-generic
node-pre-gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid
node-pre-gyp ERR! node -v v8.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build/Release/HID.node --module_name=HID --module_path=/usr/lib/node_modules/msi-keyboard-cli/node_modules/node-hid/build/Release' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-hid@0.5.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-hid@0.5.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/thesheeep/.npm/_logs/2017-06-16T12_01_21_992Z-debug.log
cornobils commented 5 years ago

solved this error with downgrading from 10 to 8 node version with n command on Linux