NPM Issues after Beacon Scanner Installed

Hey guys,

Been using Raspberry PIs for various stuff for a while but I have current project I'm working on for around the house. I've been working on some IBeacon stuff using Beacon Scanner node. During my testing I find that I want different nodes so I usually just install them directly through NodeRed. However, every time I install Beacon Scanner it keeps breaking something in NPM that I can't install anything else after it and I also get the same error.

I’m sure the first question from you al might be “what do you mean by every time you install Beacon Scanner?” Well since I can't find a fix I keep having to resort back to my backup image and then install the nodes I want and install Beacon Scanner last. Since I’m testing out my flow for what I’m wanting to do I find a new node I want but I can't install it. So until I fully get my project done I’m not all sure what I will end up with therefore I don’t want to have to redo all my work at the end just so I can install Beacon Scanner last. :slight_smile:

What I don't understand is what the actual issue is or how to fix it. I have found several things on different forums to delete the folders, resetting npm cache, or even trying this (‘rm -rf node_modules/*/.git/‘) found on github, and nothing so far seems allow me to install another node and I keep getting the same error. From what I can see this has been an issue with specific nodes for a several months now but I'm not seeing anything specific to Beacon Scanner, which is an assumption that the issue itself with the node and not NodeRed itself.

I know in the error log the current node I'm trying to install is TimerSwitch but I was also getting the error with Moment and others.

Here is the error that is common in the threads.

2020-01-27T01:17:06.466Z Install : node-red-contrib-timerswitch 1.2.4

2020-01-27T01:17:06.490Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-timerswitch@1.2.4
2020-01-27T01:17:15.331Z [err] npm
2020-01-27T01:17:15.332Z [err] ERR! code EISGIT
2020-01-27T01:17:15.332Z [err] npm ERR! path /home/pi/.node-red/node_modules/node-red-contrib-beacon-scanner
2020-01-27T01:17:15.335Z [err] npm
2020-01-27T01:17:15.336Z [err] ERR! git /home/pi/.node-red/node_modules/node-red-contrib-beacon-scanner: Appears to be a git repo or submodule.
2020-01-27T01:17:15.336Z [err] npm ERR! git /home/pi/.node-red/node_modules/node-red-contrib-beacon-scanner
2020-01-27T01:17:15.336Z [err] npm
2020-01-27T01:17:15.336Z [err] ERR! git Refusing to remove it. Update manually,
2020-01-27T01:17:15.336Z [err] npm ERR!
2020-01-27T01:17:15.336Z [err] git or move it out of the way first.
2020-01-27T01:17:15.354Z [err]
2020-01-27T01:17:15.355Z [err] npm ERR!
2020-01-27T01:17:15.355Z [err] A complete log of this run can be found in:
2020-01-27T01:17:15.355Z [err] npm ERR! /home/pi/.npm/_logs/2020-01-27T01_17_15_341Z-debug.log
2020-01-27T01:17:15.372Z rc=1

PI is running Buster
NPM is 6.13.6
Node is 12.14.1

Thanks for any suggestions or help

did you install the prerequisites?

Yes sir. The node functions fine at any point I install it. My only issue is once I do I can't install any others.

Well I recreated your problem. I suggest you open an issue in GitHub against node-red-beacon-scanner.

1 Like

Thank you for checking into this. Getting a second set of eyes is always helpful. They either confirm the problem or correct you. :slight_smile:

Is there a .git folder in there? If so then that is the problem. Delete it.

This is a known issue with the node. https://github.com/joeldavidw/node-red-contrib-beacon-scanner/issues/6

I wonder whether @314PITester did not cd .node-red before doing the above.

I did install it while in the .node-red folder and encountered the same issue

I meant that he/she was not in the .node-red folder when running rm -rf node_modules/*/.git/

1 Like

I go by a lot of things, if you ask my friends. So "He" is fine. :slight_smile:

I did run that command under .node-red. Thanks for checking though.

Have you checked whether there is a .git folder in /home/pi/.node-red/node_modules/node-red-contrib-beacon-scanner?

I have and there is not.

What does this command show?
find /home/pi/.node-red -name *.git

pi@raspberrypi:~ $ find /home/pi/.node-red -name *.git

pi@raspberrypi:~ $

Can you run the npm install that fails again please and copy/paste the full output including the command?

Actually left the house. I'll get back on this later tonight. I'll keep you posted.

Did you get to the bottom of this?

Sorry. Got tied up on a project for one of my clients.

In a round about way. I uninstalled that node and was able to install the other nodes I needed, then installed the node again. Now it is not giving me the error. So this was not the experience I was seeing before.

Even though it is working without an error now it does not solve the root problem that was happening. Since I'm up and working I have not reverted my PI back to the old image to start the process again.

I plan on doing further testing later.

But I just caused another issue, not related to this thread so I'll open another request.

I switched to a USB BLE dongle, and disabled then disabled the UART one.

dtoverlay=pi3-disable-bt

The UART one moved to HCI1 and the USB is HCI0, but both are running and my system is still using the UART (HCI1) one.

hci1: Type: Primary Bus: UART
BD Address: B8:27:EB:AF:69:F8 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:82124 acl:0 sco:0 events:2545 errors:0
TX bytes:3119 acl:0 sco:0 commands:69 errors:0
Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'raspberrypi #2'
Class: 0x480000
Service Classes: Capturing, Telephony
Device Class: Miscellaneous,
HCI Version: 5.0 (0x9) Revision: 0x122
LMP Version: 5.0 (0x9) Subversion: 0x6119
Manufacturer: Cypress Semiconductor Corporation (305)

hci0: Type: Primary Bus: USB
BD Address: 5C:F3:70:98:61:1B ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:1554 acl:0 sco:0 events:81 errors:0
TX bytes:2814 acl:0 sco:0 commands:81 errors:0
Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'raspberrypi'
Class: 0x480000
Service Classes: Capturing, Telephony
Device Class: Miscellaneous,
HCI Version: 4.0 (0x6) Revision: 0x1000
LMP Version: 4.0 (0x6) Subversion: 0x220e
Manufacturer: Broadcom Corporation (15)

Verified this by turning down HCI1.

sudo hciconfig hci0 up

So now I'm trying to figure out how to BeaconScanner, and PI, to only use HCI0. :slight_smile: