Svilen Keranov
Svilen Keranov

Reputation: 1

Can't install node-red-contrib-generic-ble or other BLE pallets

I'm a newbie trying to learn IoT systems and currently working with Node-red, influxdb and grafana to visualize simple projects. I'm running on a small Fitlet2 Linux Mint 22

I was trying to connect a Bluetooth weather station to the rest of my automation. After looking through Google, I found that the easiest way seemed to be BLE (Bluetooth Low Energy) integration to a function in a database.

I tried to install different pallets in Node-red, for example, "node-red-contrib-noble" which doesn't show all the tools after installation. "node-red-contrib-generic-ble" which can't be installed. If I try to install node-red-contrib-generic-ble from node-redd I get this output:


-----------------------------------------------------------
2024-11-10T18:28:24.621Z Install : node-red-contrib-generic-ble 4.0.3

2024-11-10T18:28:24.730Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict [email protected]
2024-11-10T18:28:44.723Z [err] npm
2024-11-10T18:28:44.724Z [err]  WARN deprecated [email protected]: This package is no longer supported.
2024-11-10T18:28:44.889Z [err] npm 
2024-11-10T18:28:44.889Z [err] WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
2024-11-10T18:28:44.981Z [err] npm WARN 
2024-11-10T18:28:44.982Z [err] deprecated [email protected]: This package is no longer supported.
2024-11-10T18:28:45.205Z [err] npm WARN 
2024-11-10T18:28:45.205Z [err] deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2024-11-10T18:28:45.320Z [err] npm WARN 
2024-11-10T18:28:45.321Z [err] deprecated [email protected]: This package is no longer supported.
2024-11-10T18:28:52.966Z [err] npm
2024-11-10T18:28:52.966Z [err]  ERR! code 1
2024-11-10T18:28:52.966Z [err] npm 
2024-11-10T18:28:52.966Z [err] ERR! path /home/legendtaioh/.node-red/node_modules/@abandonware/noble
2024-11-10T18:28:52.975Z [err] npm ERR! command failed
2024-11-10T18:28:52.975Z [err] npm ERR! command sh -c node-gyp-build
2024-11-10T18:28:52.975Z [err] npm ERR! gyp info it worked if it ends with ok
2024-11-10T18:28:52.975Z [err] npm ERR! gyp info using [email protected]
2024-11-10T18:28:52.975Z [err] npm ERR! gyp info using [email protected] | linux | x64
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! configure error 
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack   File "<string>", line 1
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-11-10T18:28:52.975Z [err] npm ERR!
2024-11-10T18:28:52.975Z [err]  gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack 
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:422:12)
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:303:5)
2024-11-10T18:28:52.975Z [err] npm ERR! gyp ERR! System Linux 6.8.0-48-generic
2024-11-10T18:28:52.975Z [err] npm 
2024-11-10T18:28:52.976Z [err] ERR! gyp ERR! command "/usr/bin/node" "/home/legendtaioh/.node-red/node_modules/.bin/node-gyp" "rebuild"
2024-11-10T18:28:52.976Z [err] npm ERR! gyp ERR! cwd /home/legendtaioh/.node-red/node_modules/@abandonware/noble
2024-11-10T18:28:52.976Z [err] npm ERR! gyp ERR! node -v v18.19.1
2024-11-10T18:28:52.976Z [err] npm ERR! gyp ERR! node-gyp -v v3.8.0
2024-11-10T18:28:52.976Z [err] npm ERR! gyp ERR! not ok
2024-11-10T18:28:52.986Z [err] 
2024-11-10T18:28:52.987Z [err] npm ERR! A complete log of this run can be found in:
2024-11-10T18:28:52.987Z [err] npm ERR!
2024-11-10T18:28:52.988Z [err]      /home/legendtaioh/.npm/_logs/2024-11-10T18_28_27_051Z-debug-0.log
2024-11-10T18:28:53.026Z rc=1

Or when i try to install it through the terminal i get:

legendtaioh@legendtaioh-FitLet2:~$ sudo npm install node-red-contrib-generic-ble
npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: This package is no longer supported.
npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated [email protected]: This package is no longer supported.

added 193 packages, and audited 204 packages in 51s

18 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (4 moderate, 3 high)

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

npm audit fix doesn't work and the npm fund details are:

legendtaioh
├── https://github.com/sponsors/isaacs
│   └── [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
├─┬ https://github.com/chalk/chalk?sponsor=1
│ │ └── [email protected]
│ └── https://github.com/chalk/ansi-styles?sponsor=1
│     └── [email protected], [email protected]
├─┬ https://opencollective.com/babel
│ │ └── @babel/[email protected]
│ └── https://opencollective.com/browserslist
│     └── [email protected], [email protected], [email protected]
├── https://github.com/sponsors/jonschlinkert
│   └── [email protected]
├── https://github.com/sponsors/sibiraj-s
│   └── [email protected]
├── https://github.com/chalk/supports-color?sponsor=1
│   └── [email protected]
├── https://github.com/sindresorhus/execa?sponsor=1
│   └── [email protected]
├── https://github.com/sponsors/dubzzz
│   └── [email protected]
├── https://github.com/sponsors/ljharb
│   └── [email protected], [email protected], [email protected], [email protected]
├── https://github.com/sindresorhus/emittery?sponsor=1
│   └── [email protected]
├── https://opencollective.com/unts
│   └── [email protected], @pkgr/[email protected]
└── https://github.com/sponsors/feross
    └── [email protected]

and the audit details are:

# npm audit report

debug  <=2.6.8
Severity: high
debug Inefficient Regular Expression Complexity vulnerability - https://github.com/advisories/GHSA-9vvw-cc9w-f27h
Regular Expression Denial of Service in debug - https://github.com/advisories/GHSA-gxpj-cx7g-858c
Depends on vulnerable versions of ms
No fix available
node_modules/debug
  noble  >=0.0.3
  Depends on vulnerable versions of debug
  node_modules/noble
    node-red-contrib-noble  *
    Depends on vulnerable versions of noble
    node_modules/node-red-contrib-noble

ms  <2.0.0
Severity: moderate
Vercel ms Inefficient Regular Expression Complexity vulnerability - https://github.com/advisories/GHSA-w9mr-4mfr-499f
No fix available
node_modules/ms

4 vulnerabilities (1 moderate, 3 high)

Some issues need review, and may require choosing
a different dependency.

For installing the noble package i get the following:

legendtaioh@legendtaioh-FitLet2:~$ sudo npm install -g node-red-contrib-noble
added 9 packages in 11s

and when i open node-red and try to enable the package it gives an error:

11/10/2024, 7:56:10 PM
msg : string[22]
"Failed to enable node:"

11/10/2024, 7:56:10 PM
msg : string[966]

" - noble : Error: Cannot find module 'bluetooth-hci-socket'
Require stack:
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/hci-socket/hci.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/hci-socket/bindings.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/resolve-bindings.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/index.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node-red-contrib-noble.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/local/lib/node_modules/node-red/lib/red.js
- /usr/local/lib/node_modules/node-red/red.js"

11/10/2024, 7:56:13 PM
msg : string[22]
"Failed to enable node:"

11/10/2024, 7:56:13 PM
msg : string[966]

" - noble : Error: Cannot find module 'bluetooth-hci-socket'
Require stack:
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/hci-socket/hci.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/hci-socket/bindings.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/resolve-bindings.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/index.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node-red-contrib-noble.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/local/lib/node_modules/node-red/lib/red.js
- /usr/local/lib/node_modules/node-red/red.js"

And the terminal output is:

10 Nov 19:56:10 - [warn] Failed to enable node:
10 Nov 19:56:10 - [warn]  - noble : Error: Cannot find module 'bluetooth-hci-socket'
Require stack:
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/hci-socket/hci.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/hci-socket/bindings.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/resolve-bindings.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/index.js
- /usr/local/lib/node_modules/node-red-contrib-noble/noble/node-red-contrib-noble.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/local/lib/node_modules/node-red/lib/red.js
- /usr/local/lib/node_modules/node-red/red.js
10 Nov 19:56:13 - [warn] Failed to enable node:
10 Nov 19:56:13 - [warn]  - noble : Error: Cannot find module 'bluetooth-hci-socket'
Require stack:
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/hci-socket/hci.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/hci-socket/bindings.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/lib/resolve-bindings.js
- /usr/local/lib/node_modules/node-red-contrib-noble/node_modules/noble/index.js
- /usr/local/lib/node_modules/node-red-contrib-noble/noble/node-red-contrib-noble.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/local/lib/node_modules/node-red/lib/red.js
- /usr/local/lib/node_modules/node-red/red.js

I've made an issue report to node-red-contrib-generic-ble/issues as well as contacted npmjs.com/support but so far no luck on progress.

Thank you!

Upvotes: 0

Views: 27

Answers (0)

Related Questions