homebridge-ranger icon indicating copy to clipboard operation
homebridge-ranger copied to clipboard

Error at install 0.3.4

Open jfgarciamex opened this issue 5 years ago • 16 comments

Hi @grover , just found a problem during a fresh installing and I fixed it. I would document for future reference:

  • When executing sudo npm install -g homebridge --unsafe-perm, I got the following error: Code 128 Command failed: /usr/bin/git clone -q git://github.com/noble/noble.git /root/.npm/_cacache/tmp/git-clone-febd287b
  • I followed this procedure (https://github.com/KraigM/homebridge-harmonyhub/issues/97) sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
  • And I was able to continue install until I got the following error: Code 1 Command failed: /usr/bin/git checkout pull/840/head
  • Finally, I found this reference (https://github.com/markserv/markserv/issues/19), and executed: npm install npm -g

After that I executed npm install -g homebridge --unsafe-perm

I got it working. I noticed that NPM was updated from 5.5.1 to 6.9.0, so I'm guessing that may be the only thing I had to do. I will try tomorrow on a new fresh install and report back. Thanks!

jfgarciamex avatar Mar 17 '19 03:03 jfgarciamex

Thanks, I’ll update the docs.

Sent with GitHawk

grover avatar Mar 17 '19 11:03 grover

Just a brief update to document after another fresh install:

  • After installing node.js 9.3.0 (and npm 5.5.1), need to upgrade to 6.9.0 with sudo npm install npm -g

  • Then before installing homebridge-ranger 0.3.4: sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

  • And install homebridge-ranger with: npm install -g homebridge-ranger --unsafe-perm

jfgarciamex avatar Mar 17 '19 14:03 jfgarciamex

Hi Guys, I am trying a fresh install on raspian, and am running into a persistent problem when trying to install homebridge-ranger. I followed the instructions above. This is what I get:

root@raspberrypi:~# npm --verbose install -g homebridge-ranger --unsafe-perm npm info it worked if it ends with ok npm verb cli [ '/opt/node-v9.3.0-linux-armv6l/bin/node', npm verb cli '/usr/bin/npm', npm verb cli '--verbose', npm verb cli 'install', npm verb cli '-g', npm verb cli 'homebridge-ranger', npm verb cli '--unsafe-perm' ] npm info using [email protected] npm info using [email protected] npm verb npm-session 841a62157641bc2f npm http fetch GET 200 https://registry.npmjs.org/homebridge-ranger 561ms (from cache) npm timing stage:loadCurrentTree Completed in 1840ms npm timing stage:loadIdealTree:cloneCurrentTree Completed in 18ms npm timing stage:loadIdealTree:loadShrinkwrap Completed in 161ms npm http fetch GET 200 https://registry.npmjs.org/ble-executor 1539ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/buffer-shims 1523ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/chalk 1519ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/clone 1557ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/curve25519-n2 1534ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/debug 1522ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/ed25519 1556ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/fast-srp-hap 1529ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/hap-nodejs 1569ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/moment 1612ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/sequential-task-queue 175ms (from cache) npm http fetch GET 200 https://registry.npmjs.org/uuid 190ms (from cache) npm timing stage:rollbackFailedOptional Completed in 32ms npm timing stage:runTopLevelLifecycles Completed in 6740ms npm verb stack Error: exited with error code: 128 npm verb stack at ChildProcess. (/opt/node-v9.3.0-linux-armv6l/lib/node_modules/npm/node_modules/pacote/lib/util/finished.js:12:19) npm verb stack at ChildProcess.emit (events.js:159:13) npm verb stack at maybeClose (internal/child_process.js:943:16) npm verb stack at Socket.stream.socket.on (internal/child_process.js:363:11) npm verb stack at Socket.emit (events.js:159:13) npm verb stack at Pipe._handle.close [as _onclose] (net.js:568:12) npm verb cwd /root npm verb Linux 4.19.42+ npm verb argv "/opt/node-v9.3.0-linux-armv6l/bin/node" "/usr/bin/npm" "--verbose" "install" "-g" "homebridge-ranger" "--unsafe-perm" npm verb node v9.3.0 npm verb npm v6.9.0 npm ERR! Error while executing: npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/noble/noble.git npm ERR! npm ERR! fatal: failed to stat '.': Permission denied npm ERR! npm ERR! exited with error code: 128 npm verb exit [ 1, true ]

Any hint would be appreciated!

SFKV avatar May 23 '19 14:05 SFKV

FYI

I've managed to get an install working without error on Raspberry PI Raspbian with Node v10.16.0 and nom 6.9.0

Ended up changing dependency for noble to https://github.com/abandonware/node-bluetooth-hci-socket.

To achieve this I had to fork homebridge-ranger and modified a dependency as follows:

"ble-executor": "git+https://github.com/vectronic/ble-executor.git"

which in turn has a modified dependency:

"noble": "git+https://github.com/vectronic/noble.git"

which in turn has a modified dependency:

"bluetooth-hci-socket": "git+https://github.com/abandonware/node-bluetooth-hci-socket"

I'm not vouching that I have a working install (but it looks reasonably good so far).

vectronic avatar Jul 31 '19 00:07 vectronic

FYI

I've managed to get an install working without error on Raspberry PI Raspbian with Node v10.16.0 and nom 6.9.0

Ended up changing dependency for noble to https://github.com/abandonware/node-bluetooth-hci-socket.

To achieve this I had to fork homebridge-ranger and modified a dependency as follows:

"ble-executor": "git+https://github.com/vectronic/ble-executor.git"

which in turn has a modified dependency:

"noble": "git+https://github.com/vectronic/noble.git"

which in turn has a modified dependency:

"bluetooth-hci-socket": "git+https://github.com/abandonware/node-bluetooth-hci-socket"

I'm not vouching that I have a working install (but it looks reasonably good so far).

Hello I have the same problem with the current installer. I didn't find your fork, how can I solve?

sudo npm install -g homebridge-ranger --unsafe-perm npm ERR! path git npm ERR! code ENOENT npm ERR! errno ENOENT npm ERR! syscall spawn git npm ERR! enoent Error while executing: npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/noble/noble.git npm ERR! enoent npm ERR! enoent npm ERR! enoent spawn git ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

sorriso93 avatar Nov 16 '19 13:11 sorriso93

@sorriso93 Workaround:

sudo npm install -g --unsafe-perm @abandonware/bluetooth-hci-socket

sudo su
sudo npm install -g homebridge-ranger --unsafe-perm

cp -r /usr/local/lib/node_modules/@abandonware/bluetooth-hci-socket /usr/local/lib/node_modules/homebridge-ranger/node_modules/

sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)

palasinio avatar Jan 25 '20 20:01 palasinio

changing dependency for noble to https://github.com/abandonware/node-bluetooth-hci-socket

  • fork "homebridge-ranger" and modify a dependency in "package.json" as follows: "ble-executor": "git+https://github.com/my git user/ble-executor.git"

  • fork "ble-executor" and modify a dependency in "package.json" as follows: "noble": "git+https://github.com/abandonware/noble.git"

this works for node 10 (tested /w 10.18.1)

palasinio avatar Jan 26 '20 17:01 palasinio

changing dependency for noble to https://github.com/abandonware/node-bluetooth-hci-socket

  • fork "homebridge-ranger" and modify a dependency in "package.json" as follows: "ble-executor": "git+https://github.com//ble-executor.git"
  • fork "ble-executor" and modify a dependency in "package.json" as follows: "noble": "git+https://github.com/abandonware/noble.git"

this works for node 10 (tested /w 10.18.1)

thanks as soon as I have time I will try again on my homebridge. I let you know

sorriso93 avatar Feb 18 '20 21:02 sorriso93

changing dependency for noble to https://github.com/abandonware/node-bluetooth-hci-socket

  • fork "homebridge-ranger" and modify a dependency in "package.json" as follows: "ble-executor": "git+https://github.com//ble-executor.git"
  • fork "ble-executor" and modify a dependency in "package.json" as follows: "noble": "git+https://github.com/abandonware/noble.git"

this works for node 10 (tested /w 10.18.1)

Hello till installation of @abandonware/bluetooth-hci-socket all ok. Then trying to install homebridge-ranger I get same error. Probably I have to git clone (fork) your repository for homebridge-ranger and "ble-executor but then, probably is a stupid question, how can I install via npm the local plugin instead of the official repository? thanks

sorriso93 avatar Mar 01 '20 16:03 sorriso93

Look at https://github.com/palasinio/homebridge-ranger/blob/master/package.json for an example or try to install palasinio/homebridge-ranger. If you do it yourself, you have to fork ble-executor and ranger. This „ "ble-executor": "git+https://github.com//ble-executor.git"“ should be „ "ble-executor": "git+https://github.com/your github user/ble-executor.git"“. Afterwards you need to install your modified version with npm install yourgituser/homebridge-ranger (maybe -g —unsafepermissions)..

palasinio avatar Mar 01 '20 20:03 palasinio

sudo npm install -g --unsafe-perm palasinio/homebridge-ranger This version will install with Node 12

palasinio avatar Mar 07 '20 23:03 palasinio

sudo npm install -g --unsafe-perm palasinio/homebridge-ranger This version will install with Node 12

root@RASPB3DIETPI:~# node -v v12.16.1 root@RASPB3DIETPI:~# npm -v 6.13.4

I get this error... sorry (lot of rows, only reported the first)

sudo npm install -g --unsafe-perm palasinio/homebridge-ranger npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/os-homedir-0cee5679/package.json' npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/os-homedir-0cee5679/index.js' npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/os-homedir-0cee5679/license' npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/os-homedir-0cee5679/readme.md' npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/minimist-603de8be/example/parse.js' npm WARN tar ENOENT: no such file or directory, open '/usr/local/lib/node_modules/.staging/minimist-603de8be/readme.markdown'

sorriso93 avatar Mar 08 '20 23:03 sorriso93

Finally I've got it. Probably it was the distribution I used (dietpi). with raspbian lite seems ok, at least now it is installed! thanks

sorriso93 avatar Apr 09 '20 21:04 sorriso93

Ok it extend my koogeek contact sensor but the state doesn't get updated if I open the window...

sorriso93 avatar Apr 13 '20 11:04 sorriso93

Hey @palasinio - can you take a look at https://github.com/grover/homebridge-ranger/issues/43 please?

gewaechshaus avatar Oct 26 '20 14:10 gewaechshaus

@gewaechshaus: added the fixes from #43 to: sudo npm install -g --unsafe-perm palasinio/homebridge-ranger

in my case EVE Thermo is not working /w HB > 1.2.5. Maybe you give it a try ;)

palasinio avatar Mar 18 '21 22:03 palasinio