grover / homebridge-ranger

A HomeKit range extender for Bluetooth Low Energy (BLE) accessories.
MIT License
73 stars 15 forks source link

Error at install 0.3.4 #16

Open jfgarciamex opened 5 years ago

jfgarciamex commented 5 years ago

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

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!

grover commented 5 years ago

Thanks, I’ll update the docs.

Sent with GitHawk

jfgarciamex commented 5 years ago

Just a brief update to document after another fresh install:

SFKV commented 5 years ago

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 npm@6.9.0 npm info using node@v9.3.0 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://git@github.com/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!

vectronic commented 5 years ago

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).

sorriso93 commented 4 years ago

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://git@github.com/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

palasinio commented 4 years ago

@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 commented 4 years ago

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

this works for node 10 (tested /w 10.18.1)

sorriso93 commented 4 years ago

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

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 commented 4 years ago

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

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

palasinio commented 4 years ago

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 commented 4 years ago

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

sorriso93 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

gewaechshaus commented 3 years ago

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

palasinio commented 3 years ago

@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 ;)